1 /////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2009-2013.
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)
9 // See http://www.boost.org/libs/intrusive for documentation.
11 /////////////////////////////////////////////////////////////////////////////
13 #ifndef BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
14 #define BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
16 #ifndef BOOST_CONFIG_HPP
17 # include <boost/config.hpp>
20 #if defined(BOOST_HAS_PRAGMA_ONCE)
24 #if defined(_MSC_VER) && (_MSC_VER <= 1310)
26 #include <boost/intrusive/detail/mpl.hpp>
32 template<class ValueTraits>
33 struct is_stateful_value_traits
35 static const bool value = !detail::is_empty<ValueTraits>::value;
42 #include <boost/intrusive/detail/function_detector.hpp>
44 BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(to_node_ptr, boost_intrusive)
45 BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(to_value_ptr, boost_intrusive)
51 template<class ValueTraits>
52 struct is_stateful_value_traits
54 typedef typename ValueTraits::node_ptr node_ptr;
55 typedef typename ValueTraits::pointer pointer;
56 typedef typename ValueTraits::value_type value_type;
57 typedef typename ValueTraits::const_node_ptr const_node_ptr;
58 typedef typename ValueTraits::const_pointer const_pointer;
60 typedef ValueTraits value_traits;
62 static const bool value =
63 (boost::intrusive::function_detector::NonStaticFunction ==
64 (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, node_ptr, to_node_ptr, (value_type&) )))
66 (boost::intrusive::function_detector::NonStaticFunction ==
67 (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, pointer, to_value_ptr, (node_ptr) )))
69 (boost::intrusive::function_detector::NonStaticFunction ==
70 (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, const_node_ptr, to_node_ptr, (const value_type&) )))
72 (boost::intrusive::function_detector::NonStaticFunction ==
73 (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, const_pointer, to_value_ptr, (const_node_ptr) )))
81 #endif //@ifndef BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP