File indexing completed on 2025-01-18 09:38:47
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef BOOST_INTRUSIVE_TRIVIAL_VALUE_TRAITS_HPP
0014 #define BOOST_INTRUSIVE_TRIVIAL_VALUE_TRAITS_HPP
0015
0016 #include <boost/intrusive/detail/config_begin.hpp>
0017 #include <boost/intrusive/detail/workaround.hpp>
0018 #include <boost/intrusive/intrusive_fwd.hpp>
0019 #include <boost/intrusive/link_mode.hpp>
0020 #include <boost/intrusive/pointer_traits.hpp>
0021
0022 #if defined(BOOST_HAS_PRAGMA_ONCE)
0023 # pragma once
0024 #endif
0025
0026 namespace boost {
0027 namespace intrusive {
0028
0029
0030
0031
0032 template<class NodeTraits, link_mode_type LinkMode
0033 #ifdef BOOST_INTRUSIVE_DOXYGEN_INVOKED
0034 = safe_link
0035 #endif
0036 >
0037 struct trivial_value_traits
0038 {
0039 typedef NodeTraits node_traits;
0040 typedef typename node_traits::node_ptr node_ptr;
0041 typedef typename node_traits::const_node_ptr const_node_ptr;
0042 typedef typename node_traits::node value_type;
0043 typedef node_ptr pointer;
0044 typedef const_node_ptr const_pointer;
0045 static const link_mode_type link_mode = LinkMode;
0046 BOOST_INTRUSIVE_FORCEINLINE static node_ptr to_node_ptr (value_type &value) BOOST_NOEXCEPT
0047 { return pointer_traits<node_ptr>::pointer_to(value); }
0048 BOOST_INTRUSIVE_FORCEINLINE static const_node_ptr to_node_ptr (const value_type &value) BOOST_NOEXCEPT
0049 { return pointer_traits<const_node_ptr>::pointer_to(value); }
0050 BOOST_INTRUSIVE_FORCEINLINE static pointer to_value_ptr(node_ptr n) BOOST_NOEXCEPT
0051 { return n; }
0052 BOOST_INTRUSIVE_FORCEINLINE static const_pointer to_value_ptr(const_node_ptr n) BOOST_NOEXCEPT
0053 { return n; }
0054 };
0055
0056 }
0057 }
0058
0059 #include <boost/intrusive/detail/config_end.hpp>
0060
0061 #endif