empty_deleter.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright Andrey Semashev 2007 - 2013.
  3. * Distributed under the Boost Software License, Version 1.0.
  4. * (See accompanying file LICENSE_1_0.txt or copy at
  5. * http://www.boost.org/LICENSE_1_0.txt)
  6. */
  7. /*!
  8. * \file empty_deleter.hpp
  9. * \author Andrey Semashev
  10. * \date 22.04.2007
  11. *
  12. * This header contains an \c empty_deleter implementation. This is an empty
  13. * function object that receives a pointer and does nothing with it.
  14. * Such empty deletion strategy may be convenient, for example, when
  15. * constructing <tt>shared_ptr</tt>s that point to some object that should not be
  16. * deleted (i.e. a variable on the stack or some global singleton, like <tt>std::cout</tt>).
  17. */
  18. #ifndef BOOST_UTILITY_EMPTY_DELETER_HPP
  19. #define BOOST_UTILITY_EMPTY_DELETER_HPP
  20. #include <boost/config.hpp>
  21. #include <boost/core/null_deleter.hpp>
  22. #ifdef BOOST_HAS_PRAGMA_ONCE
  23. #pragma once
  24. #endif
  25. #if defined(__GNUC__)
  26. #pragma message "This header is deprecated, use boost/core/null_deleter.hpp instead."
  27. #elif defined(_MSC_VER)
  28. #pragma message("This header is deprecated, use boost/core/null_deleter.hpp instead.")
  29. #endif
  30. namespace boost {
  31. //! A deprecated name for \c null_deleter
  32. typedef null_deleter empty_deleter;
  33. } // namespace boost
  34. #endif // BOOST_UTILITY_EMPTY_DELETER_HPP