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
20 #include <boost/interprocess/detail/config_begin.hpp>
23 namespace interprocess {
29 struct remove_reference
35 struct remove_reference<T&>
43 static const bool value = false;
47 struct is_reference<T&>
49 static const bool value = true;
55 static const bool value = false;
61 static const bool value = true;
71 struct add_reference<T&>
77 struct add_reference<void>
83 struct add_reference<const void>
85 typedef const nat &type;
89 struct add_const_reference
90 { typedef const T &type; };
93 struct add_const_reference<T&>
103 struct remove_const<const T>
109 struct remove_volatile
115 struct remove_volatile<volatile T>
121 struct remove_const_volatile
123 typedef typename remove_const<typename remove_volatile<T>::type>::type type;
126 template <typename T, typename U>
129 typedef char yes_type;
135 template <typename V>
136 static yes_type is_same_tester(V*, V*);
137 static no_type is_same_tester(...);
142 static const bool value = sizeof(yes_type) == sizeof(is_same_tester(t,u));
145 template<class T, class U>
148 static const bool value = is_same< typename remove_const_volatile<T>::type
149 , typename remove_const_volatile<U>::type >::value;
152 } // namespace ipcdetail
153 } //namespace interprocess {
154 } //namespace boost {
156 #include <boost/interprocess/detail/config_end.hpp>
158 #endif //#ifndef BOOST_INTERPROCESS_DETAIL_TYPE_TRAITS_HPP