1 //////////////////////////////////////////////////////////////////////////////
2 // (C) Copyright John Maddock 2000.
3 // (C) Copyright Ion Gaztanaga 2005-2012.
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/interprocess for documentation.
11 //////////////////////////////////////////////////////////////////////////////
13 #ifndef BOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP
14 #define BOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP
16 #ifndef BOOST_CONFIG_HPP
17 # include <boost/config.hpp>
20 #if defined(BOOST_HAS_PRAGMA_ONCE)
24 #include <boost/interprocess/detail/config_begin.hpp>
27 namespace interprocess {
33 struct remove_reference
39 struct remove_reference<T&>
47 static const bool value = false;
51 struct is_reference<T&>
53 static const bool value = true;
59 static const bool value = false;
65 static const bool value = true;
75 struct add_reference<T&>
81 struct add_reference<void>
87 struct add_reference<const void>
89 typedef const nat &type;
93 struct add_const_reference
94 { typedef const T &type; };
97 struct add_const_reference<T&>
107 struct remove_const<const T>
113 struct remove_volatile
119 struct remove_volatile<volatile T>
125 struct remove_const_volatile
127 typedef typename remove_const<typename remove_volatile<T>::type>::type type;
130 template <typename T, typename U>
133 typedef char yes_type;
139 template <typename V>
140 static yes_type is_same_tester(V*, V*);
141 static no_type is_same_tester(...);
146 static const bool value = sizeof(yes_type) == sizeof(is_same_tester(t,u));
149 template<class T, class U>
152 static const bool value = is_same< typename remove_const_volatile<T>::type
153 , typename remove_const_volatile<U>::type >::value;
156 } // namespace ipcdetail
157 } //namespace interprocess {
158 } //namespace boost {
160 #include <boost/interprocess/detail/config_end.hpp>
162 #endif //#ifndef BOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP