Chris@102: /* Chris@102: * Copyright Andrey Semashev 2007 - 2014. Chris@102: * Distributed under the Boost Software License, Version 1.0. Chris@102: * (See accompanying file LICENSE_1_0.txt or copy at Chris@102: * http://www.boost.org/LICENSE_1_0.txt) Chris@102: */ Chris@102: /*! Chris@102: * \file null_deleter.hpp Chris@102: * \author Andrey Semashev Chris@102: * \date 22.04.2007 Chris@102: * Chris@102: * This header contains a \c null_deleter implementation. This is an empty Chris@102: * function object that receives a pointer and does nothing with it. Chris@102: * Such empty deletion strategy may be convenient, for example, when Chris@102: * constructing shared_ptrs that point to some object that should not be Chris@102: * deleted (i.e. a variable on the stack or some global singleton, like std::cout). Chris@102: */ Chris@102: Chris@102: #ifndef BOOST_CORE_NULL_DELETER_HPP Chris@102: #define BOOST_CORE_NULL_DELETER_HPP Chris@102: Chris@102: #include Chris@102: Chris@102: #ifdef BOOST_HAS_PRAGMA_ONCE Chris@102: #pragma once Chris@102: #endif Chris@102: Chris@102: namespace boost { Chris@102: Chris@102: //! A function object that does nothing and can be used as an empty deleter for \c shared_ptr Chris@102: struct null_deleter Chris@102: { Chris@102: //! Function object result type Chris@102: typedef void result_type; Chris@102: /*! Chris@102: * Does nothing Chris@102: */ Chris@102: template< typename T > Chris@102: void operator() (T*) const BOOST_NOEXCEPT {} Chris@102: }; Chris@102: Chris@102: } // namespace boost Chris@102: Chris@102: #endif // BOOST_CORE_NULL_DELETER_HPP