Chris@16
|
1 /////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
2 //
|
Chris@16
|
3 // (C) Copyright Ion Gaztanaga 2009-2013.
|
Chris@16
|
4 //
|
Chris@16
|
5 // Distributed under the Boost Software License, Version 1.0.
|
Chris@16
|
6 // (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
7 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
8 //
|
Chris@16
|
9 // See http://www.boost.org/libs/intrusive for documentation.
|
Chris@16
|
10 //
|
Chris@16
|
11 /////////////////////////////////////////////////////////////////////////////
|
Chris@16
|
12
|
Chris@16
|
13 #ifndef BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
|
Chris@16
|
14 #define BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
|
Chris@16
|
15
|
Chris@101
|
16 #ifndef BOOST_CONFIG_HPP
|
Chris@101
|
17 # include <boost/config.hpp>
|
Chris@101
|
18 #endif
|
Chris@101
|
19
|
Chris@101
|
20 #if defined(BOOST_HAS_PRAGMA_ONCE)
|
Chris@101
|
21 # pragma once
|
Chris@101
|
22 #endif
|
Chris@16
|
23
|
Chris@16
|
24 #if defined(_MSC_VER) && (_MSC_VER <= 1310)
|
Chris@16
|
25
|
Chris@16
|
26 #include <boost/intrusive/detail/mpl.hpp>
|
Chris@16
|
27
|
Chris@16
|
28 namespace boost {
|
Chris@16
|
29 namespace intrusive {
|
Chris@16
|
30 namespace detail {
|
Chris@16
|
31
|
Chris@16
|
32 template<class ValueTraits>
|
Chris@16
|
33 struct is_stateful_value_traits
|
Chris@16
|
34 {
|
Chris@16
|
35 static const bool value = !detail::is_empty_class<ValueTraits>::value;
|
Chris@16
|
36 };
|
Chris@16
|
37
|
Chris@16
|
38 }}}
|
Chris@16
|
39
|
Chris@16
|
40 #else
|
Chris@16
|
41
|
Chris@16
|
42 #include <boost/intrusive/detail/function_detector.hpp>
|
Chris@16
|
43
|
Chris@16
|
44 BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(to_node_ptr, boost_intrusive)
|
Chris@16
|
45 BOOST_INTRUSIVE_CREATE_FUNCTION_DETECTOR(to_value_ptr, boost_intrusive)
|
Chris@16
|
46
|
Chris@16
|
47 namespace boost {
|
Chris@16
|
48 namespace intrusive {
|
Chris@16
|
49 namespace detail {
|
Chris@16
|
50
|
Chris@16
|
51 template<class ValueTraits>
|
Chris@16
|
52 struct is_stateful_value_traits
|
Chris@16
|
53 {
|
Chris@16
|
54 typedef typename ValueTraits::node_ptr node_ptr;
|
Chris@16
|
55 typedef typename ValueTraits::pointer pointer;
|
Chris@16
|
56 typedef typename ValueTraits::value_type value_type;
|
Chris@16
|
57 typedef typename ValueTraits::const_node_ptr const_node_ptr;
|
Chris@16
|
58 typedef typename ValueTraits::const_pointer const_pointer;
|
Chris@16
|
59
|
Chris@16
|
60 typedef ValueTraits value_traits;
|
Chris@16
|
61
|
Chris@16
|
62 static const bool value =
|
Chris@16
|
63 (boost::intrusive::function_detector::NonStaticFunction ==
|
Chris@16
|
64 (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, node_ptr, to_node_ptr, (value_type&) )))
|
Chris@16
|
65 ||
|
Chris@16
|
66 (boost::intrusive::function_detector::NonStaticFunction ==
|
Chris@16
|
67 (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, pointer, to_value_ptr, (node_ptr) )))
|
Chris@16
|
68 ||
|
Chris@16
|
69 (boost::intrusive::function_detector::NonStaticFunction ==
|
Chris@16
|
70 (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, const_node_ptr, to_node_ptr, (const value_type&) )))
|
Chris@16
|
71 ||
|
Chris@16
|
72 (boost::intrusive::function_detector::NonStaticFunction ==
|
Chris@16
|
73 (BOOST_INTRUSIVE_DETECT_FUNCTION(ValueTraits, boost_intrusive, const_pointer, to_value_ptr, (const_node_ptr) )))
|
Chris@16
|
74 ;
|
Chris@16
|
75 };
|
Chris@16
|
76
|
Chris@16
|
77 }}}
|
Chris@16
|
78
|
Chris@16
|
79 #endif
|
Chris@16
|
80
|
Chris@16
|
81 #endif //@ifndef BOOST_INTRUSIVE_DETAIL_IS_STATEFUL_VALUE_TRAITS_HPP
|