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