|
||||
File indexing completed on 2025-01-30 09:35:14
0001 /* 0002 * Copyright Andrey Semashev 2007 - 2014. 0003 * Distributed under the Boost Software License, Version 1.0. 0004 * (See accompanying file LICENSE_1_0.txt or copy at 0005 * http://www.boost.org/LICENSE_1_0.txt) 0006 */ 0007 /*! 0008 * \file null_deleter.hpp 0009 * \author Andrey Semashev 0010 * \date 22.04.2007 0011 * 0012 * This header contains a \c null_deleter implementation. This is an empty 0013 * function object that receives a pointer and does nothing with it. 0014 * Such empty deletion strategy may be convenient, for example, when 0015 * constructing <tt>shared_ptr</tt>s that point to some object that should not be 0016 * deleted (i.e. a variable on the stack or some global singleton, like <tt>std::cout</tt>). 0017 */ 0018 0019 #ifndef BOOST_CORE_NULL_DELETER_HPP 0020 #define BOOST_CORE_NULL_DELETER_HPP 0021 0022 #include <boost/config.hpp> 0023 0024 #ifdef BOOST_HAS_PRAGMA_ONCE 0025 #pragma once 0026 #endif 0027 0028 namespace boost { 0029 0030 //! A function object that does nothing and can be used as an empty deleter for \c shared_ptr 0031 struct null_deleter 0032 { 0033 //! Function object result type 0034 typedef void result_type; 0035 /*! 0036 * Does nothing 0037 */ 0038 template< typename T > 0039 void operator() (T*) const BOOST_NOEXCEPT {} 0040 }; 0041 0042 } // namespace boost 0043 0044 #endif // BOOST_CORE_NULL_DELETER_HPP
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |