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(__has_builtin) && (!(defined(__CUDACC__) && (__CUDACC_VER_MAJOR__ < 11)) || defined(__CUDA__))
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_builtin(__is_trivially_constructible)
187# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __is_trivially_constructible(T)
188# elif __has_feature(has_trivial_constructor)
189# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
190# endif
191# if __has_builtin(__is_trivially_copyable)
192# define BOOST_HAS_TRIVIAL_COPY(T) (__is_trivially_copyable(T) && !is_reference<T>::value)
193# elif __has_feature(has_trivial_copy)
194# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
195# endif
196# if __has_builtin(__is_trivially_assignable)
197# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__is_trivially_assignable(T&, const T&) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
198# elif __has_feature(has_trivial_assign)
199# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
200# endif
201# if __has_builtin(__is_trivially_destructible)
202# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__is_trivially_destructible(T) && is_destructible<T>::value)
203# elif __has_feature(has_trivial_destructor)
204# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) && is_destructible<T>::value)
205# endif
206# if __has_builtin(__is_nothrow_constructible)
207# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__is_nothrow_constructible(T) && is_default_constructible<T>::value)
208# elif __has_feature(has_nothrow_constructor)
209# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value)
210# endif
211# if __has_builtin(__is_nothrow_constructible)
212# define BOOST_HAS_NOTHROW_COPY(T) (__is_nothrow_constructible(T, const T&) && !is_volatile<T>::value && !is_reference<T>::value && is_copy_constructible<T>::value)
213# elif __has_feature(has_nothrow_copy)
214# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value && is_copy_constructible<T>::value)
215# endif
216# if __has_builtin(__is_nothrow_assignable)
217# define BOOST_HAS_NOTHROW_ASSIGN(T) (__is_nothrow_assignable(T&, const T&) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
218# elif __has_feature(has_nothrow_assign)
219# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
220# endif
221# if __has_feature(has_virtual_destructor)
222# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
223# endif
224# if __has_feature(is_abstract)
225# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
226# endif
227# if __has_feature(is_base_of)
228# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
229# endif
230# if __has_feature(is_class)
231# define BOOST_IS_CLASS(T) __is_class(T)
232# endif
233# if __has_feature(is_convertible_to)
234# define BOOST_IS_CONVERTIBLE(T,U) __is_convertible_to(T,U)
235# endif
236# if __has_feature(is_enum)
237# define BOOST_IS_ENUM(T) __is_enum(T)
238# endif
239# if __has_feature(is_polymorphic)
240# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
241# endif
242#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
243# if __has_extension(is_trivially_constructible)
244# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__is_trivially_constructible(T, T&&) && is_constructible<T, T&&>::value && !::boost::is_volatile<T>::value)
245# endif
246# if __has_extension(is_trivially_assignable)
247# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__is_trivially_assignable(T&, T&&) && is_assignable<T&, T&&>::value && !::boost::is_volatile<T>::value)
248# endif
249#endif
250# if (!defined(unix) && !defined(__unix__)) || defined(__LP64__) || !defined(__GNUC__)
251// GCC sometimes lies about alignment requirements
252// of type double on 32-bit unix platforms, use the
253// old implementation instead in that case:
254# define BOOST_ALIGNMENT_OF(T) __alignof(T)
255# endif
256# if __has_feature(is_final)
257# define BOOST_IS_FINAL(T) __is_final(T)
258# endif
259
260# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
261#endif
262
263#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__))) && !defined(BOOST_CLANG)
264//
265// Note that even though these intrinsics rely on other type traits classes
266// we do not #include those here as it produces cyclic dependencies and
267// can cause the intrinsics to not even be used at all!
268//
269
270#ifdef BOOST_INTEL
271# define BOOST_INTEL_TT_OPTS || is_pod<T>::value
272#else
273# define BOOST_INTEL_TT_OPTS
274#endif
275
276# define BOOST_IS_UNION(T) __is_union(T)
277# define BOOST_IS_POD(T) __is_pod(T)
278# define BOOST_IS_EMPTY(T) __is_empty(T)
279# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ((__has_trivial_constructor(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value)
280# define BOOST_HAS_TRIVIAL_COPY(T) ((__has_trivial_copy(T) BOOST_INTEL_TT_OPTS) && !is_reference<T>::value)
281#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409
282# 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)
283# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS && is_destructible<T>::value)
284# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value BOOST_INTEL_TT_OPTS)
285# 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)
286# 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)
287#else
288# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value)
289# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS)
290# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) BOOST_INTEL_TT_OPTS)
291#if ((__GNUC__ * 100 + __GNUC_MINOR__) != 407) && ((__GNUC__ * 100 + __GNUC_MINOR__) != 408)
292# 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)
293#endif
294# 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)
295#endif
296# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
297
298# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
299# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
300# define BOOST_IS_CLASS(T) __is_class(T)
301# define BOOST_IS_ENUM(T) __is_enum(T)
302# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
303# if (!defined(unix) && !defined(__unix__) && \
304 !(defined(__VXWORKS__) && defined(__i386__))) || defined(__LP64__)
305 // GCC sometimes lies about alignment requirements
306 // of type double on 32-bit unix platforms, use the
307 // old implementation instead in that case:
308# define BOOST_ALIGNMENT_OF(T) __alignof__(T)
309# endif
310# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))
311# define BOOST_IS_FINAL(T) __is_final(T)
312# endif
313
314# if (__GNUC__ >= 5) && (__cplusplus >= 201103)
315# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__is_trivially_assignable(T&, T&&) && is_assignable<T&, T&&>::value && !::boost::is_volatile<T>::value)
316# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__is_trivially_constructible(T, T&&) && is_constructible<T, T&&>::value && !::boost::is_volatile<T>::value)
317# endif
318
319# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
320#endif
321
322#if defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)
323# define BOOST_IS_UNION(T) __oracle_is_union(T)
324# define BOOST_IS_POD(T) (__oracle_is_pod(T) && !is_function<T>::value)
325# define BOOST_IS_EMPTY(T) __oracle_is_empty(T)
326# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__oracle_has_trivial_constructor(T) && ! ::boost::is_volatile<T>::value)
327# define BOOST_HAS_TRIVIAL_COPY(T) (__oracle_has_trivial_copy(T) && !is_reference<T>::value)
328# 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)
329# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__oracle_has_trivial_destructor(T) && is_destructible<T>::value)
330# 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)
331// __oracle_has_nothrow_copy appears to behave the same as __oracle_has_nothrow_assign, disabled for now:
332//# 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)
333# 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)
334# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __oracle_has_virtual_destructor(T)
335
336# define BOOST_IS_ABSTRACT(T) __oracle_is_abstract(T)
337//# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
338# define BOOST_IS_CLASS(T) __oracle_is_class(T)
339# define BOOST_IS_ENUM(T) __oracle_is_enum(T)
340# define BOOST_IS_POLYMORPHIC(T) __oracle_is_polymorphic(T)
341# define BOOST_ALIGNMENT_OF(T) __alignof__(T)
342# define BOOST_IS_FINAL(T) __oracle_is_final(T)
343
344# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
345#endif
346
347#if defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600)
348# include <boost/type_traits/is_same.hpp>
349# include <boost/type_traits/is_reference.hpp>
350# include <boost/type_traits/is_volatile.hpp>
351
352# define BOOST_IS_UNION(T) __is_union(T)
353# define BOOST_IS_POD(T) __is_pod(T)
354# define BOOST_IS_EMPTY(T) __is_empty(T)
355# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
356# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
357# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
358# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
359# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
360# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value)
361# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
362# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
363
364# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
365# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
366# define BOOST_IS_CLASS(T) __is_class(T)
367# define BOOST_IS_ENUM(T) __is_enum(T)
368# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
369# define BOOST_ALIGNMENT_OF(T) __alignof__(T)
370# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
371#endif
372
373# if defined(BOOST_CODEGEARC)
374# include <boost/type_traits/is_same.hpp>
375# include <boost/type_traits/is_reference.hpp>
376# include <boost/type_traits/is_volatile.hpp>
377# include <boost/type_traits/is_void.hpp>
378
379# define BOOST_IS_UNION(T) __is_union(T)
380# define BOOST_IS_POD(T) __is_pod(T)
381# define BOOST_IS_EMPTY(T) __is_empty(T)
382# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T))
383# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_reference<T>::value)
384# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
385# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T))
386# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T))
387# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value)
388# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
389# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
390
391# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
392# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_void<T>::value && !is_void<U>::value)
393# define BOOST_IS_CLASS(T) __is_class(T)
394# define BOOST_IS_CONVERTIBLE(T,U) (__is_convertible(T,U) || is_void<U>::value)
395# define BOOST_IS_ENUM(T) __is_enum(T)
396# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
397# define BOOST_ALIGNMENT_OF(T) alignof(T)
398
399# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
400#endif
401
402#endif // BOOST_TT_DISABLE_INTRINSICS
403
404#endif // BOOST_TT_INTRINSICS_HPP_INCLUDED
405
406