simple_disposers.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #include <boost/intrusive/detail/workaround.hpp>
  15. #ifndef BOOST_CONFIG_HPP
  16. # include <boost/config.hpp>
  17. #endif
  18. #if defined(BOOST_HAS_PRAGMA_ONCE)
  19. # pragma once
  20. #endif
  21. namespace boost {
  22. namespace intrusive {
  23. namespace detail {
  24. class null_disposer
  25. {
  26. public:
  27. template <class Pointer>
  28. void operator()(Pointer)
  29. {}
  30. };
  31. template<class NodeAlgorithms>
  32. class init_disposer
  33. {
  34. typedef typename NodeAlgorithms::node_ptr node_ptr;
  35. public:
  36. inline void operator()(node_ptr p)
  37. { NodeAlgorithms::init(p); }
  38. };
  39. } //namespace detail{
  40. } //namespace intrusive{
  41. } //namespace boost{
  42. #endif //BOOST_INTRUSIVE_DETAIL_SIMPLE_DISPOSERS_HPP