simple_disposers.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2014-2014
  4. //
  5. // Distributed under the Boost Software License, Version 1.0.
  6. // (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. //
  9. // See http://www.boost.org/libs/intrusive for documentation.
  10. //
  11. /////////////////////////////////////////////////////////////////////////////
  12. #ifndef BOOST_INTRUSIVE_DETAIL_SIMPLE_DISPOSERS_HPP
  13. #define BOOST_INTRUSIVE_DETAIL_SIMPLE_DISPOSERS_HPP
  14. #ifndef BOOST_CONFIG_HPP
  15. # include <boost/config.hpp>
  16. #endif
  17. #if defined(BOOST_HAS_PRAGMA_ONCE)
  18. # pragma once
  19. #endif
  20. namespace boost {
  21. namespace intrusive {
  22. namespace detail {
  23. class null_disposer
  24. {
  25. public:
  26. template <class Pointer>
  27. void operator()(Pointer)
  28. {}
  29. };
  30. template<class NodeAlgorithms>
  31. class init_disposer
  32. {
  33. typedef typename NodeAlgorithms::node_ptr node_ptr;
  34. public:
  35. BOOST_INTRUSIVE_FORCEINLINE void operator()(const node_ptr & p)
  36. { NodeAlgorithms::init(p); }
  37. };
  38. } //namespace detail{
  39. } //namespace intrusive{
  40. } //namespace boost{
  41. #endif //BOOST_INTRUSIVE_DETAIL_SIMPLE_DISPOSERS_HPP