simple_disposers.hpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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