]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/type_traits/intrinsics.hpp
import quincy beta 17.1.0
[ceph.git] / ceph / src / boost / boost / type_traits / intrinsics.hpp
1 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
2 // Use, modification and distribution are subject to the Boost Software License,
3 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt).
5 //
6 // See http://www.boost.org/libs/type_traits for most recent version including documentation.
7
8 #ifndef BOOST_TT_INTRINSICS_HPP_INCLUDED
9 #define BOOST_TT_INTRINSICS_HPP_INCLUDED
10
11 #ifndef BOOST_TT_DISABLE_INTRINSICS
12
13 #include <boost/config.hpp>
14
15 #ifndef BOOST_TT_CONFIG_HPP_INCLUDED
16 #include <boost/type_traits/detail/config.hpp>
17 #endif
18
19 //
20 // Helper macros for builtin compiler support.
21 // If your compiler has builtin support for any of the following
22 // traits concepts, then redefine the appropriate macros to pick
23 // up on the compiler support:
24 //
25 // (these should largely ignore cv-qualifiers)
26 // BOOST_IS_UNION(T) should evaluate to true if T is a union type
27 // BOOST_IS_POD(T) should evaluate to true if T is a POD type
28 // BOOST_IS_EMPTY(T) should evaluate to true if T is an empty class type (and not a union)
29 // BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) should evaluate to true if "T x;" has no effect
30 // BOOST_HAS_TRIVIAL_COPY(T) should evaluate to true if T(t) <==> memcpy
31 // BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) should evaluate to true if T(boost::move(t)) <==> memcpy
32 // BOOST_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy
33 // BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) should evaluate to true if t = boost::move(u) <==> memcpy
34 // BOOST_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect
35 // BOOST_HAS_NOTHROW_CONSTRUCTOR(T) should evaluate to true if "T x;" can not throw
36 // BOOST_HAS_NOTHROW_COPY(T) should evaluate to true if T(t) can not throw
37 // BOOST_HAS_NOTHROW_ASSIGN(T) should evaluate to true if t = u can not throw
38 // BOOST_HAS_VIRTUAL_DESTRUCTOR(T) should evaluate to true T has a virtual destructor
39 // BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T) should evaluate to true if T has a non-throwing move constructor.
40 // BOOST_IS_NOTHROW_MOVE_ASSIGN(T) should evaluate to true if T has a non-throwing move assignment operator.
41 //
42 // The following can also be defined: when detected our implementation is greatly simplified.
43 //
44 // BOOST_IS_ABSTRACT(T) true if T is an abstract type
45 // BOOST_IS_BASE_OF(T,U) true if T is a base class of U
46 // BOOST_IS_CLASS(T) true if T is a class type (and not a union)
47 // BOOST_IS_CONVERTIBLE(T,U) true if T is convertible to U
48 // BOOST_IS_ENUM(T) true is T is an enum
49 // BOOST_IS_POLYMORPHIC(T) true if T is a polymorphic type
50 // BOOST_ALIGNMENT_OF(T) should evaluate to the alignment requirements of type T.
51 //
52 // define BOOST_TT_DISABLE_INTRINSICS to prevent any intrinsics being used (mostly used when testing)
53 //
54
55 #ifdef BOOST_HAS_SGI_TYPE_TRAITS
56 // Hook into SGI's __type_traits class, this will pick up user supplied
57 // specializations as well as SGI - compiler supplied specializations.
58 # include <boost/type_traits/is_same.hpp>
59 # ifdef __NetBSD__
60 // There are two different versions of type_traits.h on NetBSD on Spark
61 // use an implicit include via algorithm instead, to make sure we get
62 // the same version as the std lib:
63 # include <algorithm>
64 # else
65 # include <type_traits.h>
66 # endif
67 # define BOOST_IS_POD(T) ::boost::is_same< typename ::__type_traits<T>::is_POD_type, ::__true_type>::value
68 # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_default_constructor, ::__true_type>::value
69 # define BOOST_HAS_TRIVIAL_COPY(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_copy_constructor, ::__true_type>::value
70 # define BOOST_HAS_TRIVIAL_ASSIGN(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_assignment_operator, ::__true_type>::value
71 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_destructor, ::__true_type>::value
72
73 # ifdef __sgi
74 # define BOOST_HAS_TYPE_TRAITS_INTRINSICS
75 # endif
76 #endif
77
78 #if defined(__MSL_CPP__) && (__MSL_CPP__ >= 0x8000)
79 // Metrowerks compiler is acquiring intrinsic type traits support
80 // post version 8. We hook into the published interface to pick up
81 // user defined specializations as well as compiler intrinsics as
82 // and when they become available:
83 # include <msl_utility>
84 # define BOOST_IS_UNION(T) BOOST_STD_EXTENSION_NAMESPACE::is_union<T>::value
85 # define BOOST_IS_POD(T) BOOST_STD_EXTENSION_NAMESPACE::is_POD<T>::value
86 # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) BOOST_STD_EXTENSION_NAMESPACE::has_trivial_default_ctor<T>::value
87 # define BOOST_HAS_TRIVIAL_COPY(T) BOOST_STD_EXTENSION_NAMESPACE::has_trivial_copy_ctor<T>::value
88 # define BOOST_HAS_TRIVIAL_ASSIGN(T) BOOST_STD_EXTENSION_NAMESPACE::has_trivial_assignment<T>::value
89 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) BOOST_STD_EXTENSION_NAMESPACE::has_trivial_dtor<T>::value
90 # define BOOST_HAS_TYPE_TRAITS_INTRINSICS
91 #endif
92
93 #if (defined(BOOST_MSVC) && defined(BOOST_MSVC_FULL_VER) && (BOOST_MSVC_FULL_VER >=140050215))\
94 || (defined(BOOST_INTEL) && defined(_MSC_VER) && (_MSC_VER >= 1500))
95 //
96 // Note that even though these intrinsics rely on other type traits classes
97 // we do not #include those here as it produces cyclic dependencies and
98 // can cause the intrinsics to not even be used at all!
99 //
100 # define BOOST_IS_UNION(T) __is_union(T)
101 # define BOOST_IS_POD(T) (__is_pod(T) && __has_trivial_constructor(T))
102 # define BOOST_IS_EMPTY(T) __is_empty(T)
103 # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
104 # define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) || ( ::boost::is_pod<T>::value && ! ::boost::is_const<T>::value && !::boost::is_volatile<T>::value))
105 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || ::boost::is_pod<T>::value)
106 # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) || ::boost::has_trivial_constructor<T>::value)
107 #if !defined(BOOST_INTEL)
108 # define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) || ::boost::has_trivial_copy<T>::value) && !is_array<T>::value)
109 # define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) || ::boost::is_pod<T>::value)
110 #elif (_MSC_VER >= 1900)
111 # define BOOST_HAS_NOTHROW_COPY(T) ((__is_nothrow_constructible(T, typename add_lvalue_reference<typename add_const<T>::type>::type)) && !is_array<T>::value)
112 # define BOOST_HAS_TRIVIAL_COPY(T) (__is_trivially_constructible(T, typename add_lvalue_reference<typename add_const<T>::type>::type))
113 #endif
114 # define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) || ::boost::has_trivial_assign<T>::value)
115 # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
116
117 # define BOOST_IS_ABSTRACT(T) __is_abstract(T)
118 # define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
119 # define BOOST_IS_CLASS(T) __is_class(T)
120 # define BOOST_IS_CONVERTIBLE(T,U) ((__is_convertible_to(T,U) || (is_same<T,U>::value && !is_function<U>::value)) && !__is_abstract(U))
121 # define BOOST_IS_ENUM(T) __is_enum(T)
122 // This one fails if the default alignment has been changed with /Zp:
123 // # define BOOST_ALIGNMENT_OF(T) __alignof(T)
124
125 # if defined(_MSC_VER) && (_MSC_VER >= 1800)
126 # define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) ((__is_trivially_constructible(T, T&&) || boost::is_pod<T>::value) && ! ::boost::is_volatile<T>::value && ! ::boost::is_reference<T>::value)
127 # define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) ((__is_trivially_assignable(T, T&&) || boost::is_pod<T>::value) && ! ::boost::is_const<T>::value && !::boost::is_volatile<T>::value && ! ::boost::is_reference<T>::value)
128 # elif defined(_MSC_VER) && (_MSC_VER >= 1700)
129 # define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) ((__has_trivial_move_constructor(T) || boost::is_pod<T>::value) && ! ::boost::is_volatile<T>::value && ! ::boost::is_reference<T>::value)
130 # define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) ((__has_trivial_move_assign(T) || boost::is_pod<T>::value) && ! ::boost::is_const<T>::value && !::boost::is_volatile<T>::value && ! ::boost::is_reference<T>::value)
131 # endif
132 #ifndef BOOST_NO_CXX11_FINAL
133 // This one doesn't quite always do the right thing on older VC++ versions
134 // we really need it when the final keyword is supported though:
135 # define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
136 #endif
137 #if _MSC_FULL_VER >= 180020827
138 # define BOOST_IS_NOTHROW_MOVE_ASSIGN(T) (__is_nothrow_assignable(T&, T&&))
139 # define BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T) (__is_nothrow_constructible(T, T&&))
140 #endif
141 #if _MSC_VER >= 1800
142 # define BOOST_IS_FINAL(T) __is_final(T)
143 #endif
144 # define BOOST_HAS_TYPE_TRAITS_INTRINSICS
145 #endif
146
147 #if defined(__DMC__) && (__DMC__ >= 0x848)
148 // For Digital Mars C++, www.digitalmars.com
149 # define BOOST_IS_UNION(T) (__typeinfo(T) & 0x400)
150 # define BOOST_IS_POD(T) (__typeinfo(T) & 0x800)
151 # define BOOST_IS_EMPTY(T) (__typeinfo(T) & 0x1000)
152 # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__typeinfo(T) & 0x10)
153 # define BOOST_HAS_TRIVIAL_COPY(T) (__typeinfo(T) & 0x20)
154 # define BOOST_HAS_TRIVIAL_ASSIGN(T) (__typeinfo(T) & 0x40)
155 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__typeinfo(T) & 0x8)
156 # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__typeinfo(T) & 0x80)
157 # define BOOST_HAS_NOTHROW_COPY(T) (__typeinfo(T) & 0x100)
158 # define BOOST_HAS_NOTHROW_ASSIGN(T) (__typeinfo(T) & 0x200)
159 # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) (__typeinfo(T) & 0x4)
160 # define BOOST_HAS_TYPE_TRAITS_INTRINSICS
161 #endif
162
163 #if defined(BOOST_CLANG) && defined(__has_feature) && !defined(__CUDACC__)
164 //
165 // Note that these intrinsics are disabled for the CUDA meta-compiler as it appears
166 // to not support them, even though the underlying clang compiler does so.
167 // This is a rubbish fix as it basically stops type traits from working correctly,
168 // but maybe the best we can do for now. See https://svn.boost.org/trac/boost/ticket/10694
169 //
170 //
171 // Note that even though these intrinsics rely on other type traits classes
172 // we do not #include those here as it produces cyclic dependencies and
173 // can cause the intrinsics to not even be used at all!
174 //
175 # include <cstddef>
176
177 # if __has_feature(is_union)
178 # define BOOST_IS_UNION(T) __is_union(T)
179 # endif
180 # if (!defined(__GLIBCXX__) || (__GLIBCXX__ >= 20080306 && __GLIBCXX__ != 20080519)) && __has_feature(is_pod)
181 # define BOOST_IS_POD(T) __is_pod(T)
182 # endif
183 # if (!defined(__GLIBCXX__) || (__GLIBCXX__ >= 20080306 && __GLIBCXX__ != 20080519)) && __has_feature(is_empty)
184 # define BOOST_IS_EMPTY(T) __is_empty(T)
185 # endif
186 # if __has_feature(has_trivial_constructor)
187 # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
188 # endif
189 # if __has_feature(has_trivial_copy)
190 # define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
191 # endif
192 # if __has_feature(has_trivial_assign)
193 # define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
194 # endif
195 # if __has_feature(has_trivial_destructor)
196 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) && is_destructible<T>::value)
197 # endif
198 # if __has_feature(has_nothrow_constructor)
199 # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value)
200 # endif
201 # if __has_feature(has_nothrow_copy)
202 # define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value && is_copy_constructible<T>::value)
203 # endif
204 # if __has_feature(has_nothrow_assign)
205 # define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
206 # endif
207 # if __has_feature(has_virtual_destructor)
208 # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
209 # endif
210 # if __has_feature(is_abstract)
211 # define BOOST_IS_ABSTRACT(T) __is_abstract(T)
212 # endif
213 # if __has_feature(is_base_of)
214 # define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
215 # endif
216 # if __has_feature(is_class)
217 # define BOOST_IS_CLASS(T) __is_class(T)
218 # endif
219 # if __has_feature(is_convertible_to)
220 # define BOOST_IS_CONVERTIBLE(T,U) __is_convertible_to(T,U)
221 # endif
222 # if __has_feature(is_enum)
223 # define BOOST_IS_ENUM(T) __is_enum(T)
224 # endif
225 # if __has_feature(is_polymorphic)
226 # define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
227 # endif
228 #ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
229 # if __has_extension(is_trivially_constructible)
230 # define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__is_trivially_constructible(T, T&&) && is_constructible<T, T&&>::value && !::boost::is_volatile<T>::value)
231 # endif
232 # if __has_extension(is_trivially_assignable)
233 # define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__is_trivially_assignable(T&, T&&) && is_assignable<T&, T&&>::value && !::boost::is_volatile<T>::value)
234 # endif
235 #endif
236 # if (!defined(unix) && !defined(__unix__)) || defined(__LP64__) || !defined(__GNUC__)
237 // GCC sometimes lies about alignment requirements
238 // of type double on 32-bit unix platforms, use the
239 // old implementation instead in that case:
240 # define BOOST_ALIGNMENT_OF(T) __alignof(T)
241 # endif
242 # if __has_feature(is_final)
243 # define BOOST_IS_FINAL(T) __is_final(T)
244 # endif
245
246 # define BOOST_HAS_TYPE_TRAITS_INTRINSICS
247 #endif
248
249 #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__))) && !defined(BOOST_CLANG)
250 //
251 // Note that even though these intrinsics rely on other type traits classes
252 // we do not #include those here as it produces cyclic dependencies and
253 // can cause the intrinsics to not even be used at all!
254 //
255
256 #ifdef BOOST_INTEL
257 # define BOOST_INTEL_TT_OPTS || is_pod<T>::value
258 #else
259 # define BOOST_INTEL_TT_OPTS
260 #endif
261
262 # define BOOST_IS_UNION(T) __is_union(T)
263 # define BOOST_IS_POD(T) __is_pod(T)
264 # define BOOST_IS_EMPTY(T) __is_empty(T)
265 # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ((__has_trivial_constructor(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value)
266 # define BOOST_HAS_TRIVIAL_COPY(T) ((__has_trivial_copy(T) BOOST_INTEL_TT_OPTS) && !is_reference<T>::value)
267 #if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409
268 # define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value && is_assignable<T&, const T&>::value)
269 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS && is_destructible<T>::value)
270 # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value BOOST_INTEL_TT_OPTS)
271 # define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_reference<T>::value && is_copy_constructible<T>::value)
272 # define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_const<T>::value && is_assignable<T&, const T&>::value)
273 #else
274 # define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value)
275 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS)
276 # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) BOOST_INTEL_TT_OPTS)
277 #if ((__GNUC__ * 100 + __GNUC_MINOR__) != 407) && ((__GNUC__ * 100 + __GNUC_MINOR__) != 408)
278 # define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_reference<T>::value && !is_array<T>::value)
279 #endif
280 # define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_const<T>::value && !is_array<T>::value)
281 #endif
282 # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
283
284 # define BOOST_IS_ABSTRACT(T) __is_abstract(T)
285 # define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
286 # define BOOST_IS_CLASS(T) __is_class(T)
287 # define BOOST_IS_ENUM(T) __is_enum(T)
288 # define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
289 # if (!defined(unix) && !defined(__unix__) && \
290 !(defined(__VXWORKS__) && defined(__i386__))) || defined(__LP64__)
291 // GCC sometimes lies about alignment requirements
292 // of type double on 32-bit unix platforms, use the
293 // old implementation instead in that case:
294 # define BOOST_ALIGNMENT_OF(T) __alignof__(T)
295 # endif
296 # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))
297 # define BOOST_IS_FINAL(T) __is_final(T)
298 # endif
299
300 # if (__GNUC__ >= 5) && (__cplusplus >= 201103)
301 # define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__is_trivially_assignable(T&, T&&) && is_assignable<T&, T&&>::value && !::boost::is_volatile<T>::value)
302 # define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__is_trivially_constructible(T, T&&) && is_constructible<T, T&&>::value && !::boost::is_volatile<T>::value)
303 # endif
304
305 # define BOOST_HAS_TYPE_TRAITS_INTRINSICS
306 #endif
307
308 #if defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)
309 # define BOOST_IS_UNION(T) __oracle_is_union(T)
310 # define BOOST_IS_POD(T) (__oracle_is_pod(T) && !is_function<T>::value)
311 # define BOOST_IS_EMPTY(T) __oracle_is_empty(T)
312 # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__oracle_has_trivial_constructor(T) && ! ::boost::is_volatile<T>::value)
313 # define BOOST_HAS_TRIVIAL_COPY(T) (__oracle_has_trivial_copy(T) && !is_reference<T>::value)
314 # define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value && is_assignable<T&, const T&>::value)
315 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__oracle_has_trivial_destructor(T) && is_destructible<T>::value)
316 # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) ((__oracle_has_nothrow_constructor(T) || __oracle_has_trivial_constructor(T) || __oracle_is_trivial(T)) && is_default_constructible<T>::value)
317 // __oracle_has_nothrow_copy appears to behave the same as __oracle_has_nothrow_assign, disabled for now:
318 //# define BOOST_HAS_NOTHROW_COPY(T) ((__oracle_has_nothrow_copy(T) || __oracle_has_trivial_copy(T) || __oracle_is_trivial(T)) && !is_volatile<T>::value && !is_reference<T>::value && is_copy_constructible<T>::value)
319 # define BOOST_HAS_NOTHROW_ASSIGN(T) ((__oracle_has_nothrow_assign(T) || __oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && !is_volatile<T>::value && !is_const<T>::value && is_assignable<T&, const T&>::value)
320 # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __oracle_has_virtual_destructor(T)
321
322 # define BOOST_IS_ABSTRACT(T) __oracle_is_abstract(T)
323 //# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
324 # define BOOST_IS_CLASS(T) __oracle_is_class(T)
325 # define BOOST_IS_ENUM(T) __oracle_is_enum(T)
326 # define BOOST_IS_POLYMORPHIC(T) __oracle_is_polymorphic(T)
327 # define BOOST_ALIGNMENT_OF(T) __alignof__(T)
328 # define BOOST_IS_FINAL(T) __oracle_is_final(T)
329
330 # define BOOST_HAS_TYPE_TRAITS_INTRINSICS
331 #endif
332
333 #if defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600)
334 # include <boost/type_traits/is_same.hpp>
335 # include <boost/type_traits/is_reference.hpp>
336 # include <boost/type_traits/is_volatile.hpp>
337
338 # define BOOST_IS_UNION(T) __is_union(T)
339 # define BOOST_IS_POD(T) __is_pod(T)
340 # define BOOST_IS_EMPTY(T) __is_empty(T)
341 # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
342 # define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
343 # define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
344 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
345 # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
346 # define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value)
347 # define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
348 # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
349
350 # define BOOST_IS_ABSTRACT(T) __is_abstract(T)
351 # define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
352 # define BOOST_IS_CLASS(T) __is_class(T)
353 # define BOOST_IS_ENUM(T) __is_enum(T)
354 # define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
355 # define BOOST_ALIGNMENT_OF(T) __alignof__(T)
356 # define BOOST_HAS_TYPE_TRAITS_INTRINSICS
357 #endif
358
359 # if defined(BOOST_CODEGEARC)
360 # include <boost/type_traits/is_same.hpp>
361 # include <boost/type_traits/is_reference.hpp>
362 # include <boost/type_traits/is_volatile.hpp>
363 # include <boost/type_traits/is_void.hpp>
364
365 # define BOOST_IS_UNION(T) __is_union(T)
366 # define BOOST_IS_POD(T) __is_pod(T)
367 # define BOOST_IS_EMPTY(T) __is_empty(T)
368 # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T))
369 # define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_reference<T>::value)
370 # define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
371 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T))
372 # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T))
373 # define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value)
374 # define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
375 # define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
376
377 # define BOOST_IS_ABSTRACT(T) __is_abstract(T)
378 # define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_void<T>::value && !is_void<U>::value)
379 # define BOOST_IS_CLASS(T) __is_class(T)
380 # define BOOST_IS_CONVERTIBLE(T,U) (__is_convertible(T,U) || is_void<U>::value)
381 # define BOOST_IS_ENUM(T) __is_enum(T)
382 # define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
383 # define BOOST_ALIGNMENT_OF(T) alignof(T)
384
385 # define BOOST_HAS_TYPE_TRAITS_INTRINSICS
386 #endif
387
388 #endif // BOOST_TT_DISABLE_INTRINSICS
389
390 #endif // BOOST_TT_INTRINSICS_HPP_INCLUDED
391