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 >= 1700)
126# 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)
127# 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)
128# endif
129#ifndef BOOST_NO_CXX11_FINAL
130// This one doesn't quite always do the right thing on older VC++ versions
131// we really need it when the final keyword is supporyted though:
132# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
133#endif
134#if _MSC_FULL_VER >= 180020827
135# define BOOST_IS_NOTHROW_MOVE_ASSIGN(T) (__is_nothrow_assignable(T&, T&&))
136# define BOOST_IS_NOTHROW_MOVE_CONSTRUCT(T) (__is_nothrow_constructible(T, T&&))
137#endif
138# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
139#endif
140
141#if defined(__DMC__) && (__DMC__ >= 0x848)
142// For Digital Mars C++, www.digitalmars.com
143# define BOOST_IS_UNION(T) (__typeinfo(T) & 0x400)
144# define BOOST_IS_POD(T) (__typeinfo(T) & 0x800)
145# define BOOST_IS_EMPTY(T) (__typeinfo(T) & 0x1000)
146# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__typeinfo(T) & 0x10)
147# define BOOST_HAS_TRIVIAL_COPY(T) (__typeinfo(T) & 0x20)
148# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__typeinfo(T) & 0x40)
149# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__typeinfo(T) & 0x8)
150# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__typeinfo(T) & 0x80)
151# define BOOST_HAS_NOTHROW_COPY(T) (__typeinfo(T) & 0x100)
152# define BOOST_HAS_NOTHROW_ASSIGN(T) (__typeinfo(T) & 0x200)
153# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) (__typeinfo(T) & 0x4)
154# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
155#endif
156
157#if defined(BOOST_CLANG) && defined(__has_feature) && !defined(__CUDACC__)
158//
159// Note that these intrinsics are disabled for the CUDA meta-compiler as it appears
160// to not support them, even though the underlying clang compiler does so.
161// This is a rubbish fix as it basically stops type traits from working correctly,
162// but maybe the best we can do for now. See https://svn.boost.org/trac/boost/ticket/10694
163//
164//
165// Note that even though these intrinsics rely on other type traits classes
166// we do not #include those here as it produces cyclic dependencies and
167// can cause the intrinsics to not even be used at all!
168//
169# include <cstddef>
170
171# if __has_feature(is_union)
172# define BOOST_IS_UNION(T) __is_union(T)
173# endif
174# if (!defined(__GLIBCXX__) || (__GLIBCXX__ >= 20080306 && __GLIBCXX__ != 20080519)) && __has_feature(is_pod)
175# define BOOST_IS_POD(T) __is_pod(T)
176# endif
177# if (!defined(__GLIBCXX__) || (__GLIBCXX__ >= 20080306 && __GLIBCXX__ != 20080519)) && __has_feature(is_empty)
178# define BOOST_IS_EMPTY(T) __is_empty(T)
179# endif
180# if __has_feature(has_trivial_constructor)
181# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
182# endif
183# if __has_feature(has_trivial_copy)
184# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
185# endif
186# if __has_feature(has_trivial_assign)
187# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
188# endif
189# if __has_feature(has_trivial_destructor)
190# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) && is_destructible<T>::value)
191# endif
192# if __has_feature(has_nothrow_constructor)
193# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value)
194# endif
195# if __has_feature(has_nothrow_copy)
196# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value && is_copy_constructible<T>::value)
197# endif
198# if __has_feature(has_nothrow_assign)
199# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
200# endif
201# if __has_feature(has_virtual_destructor)
202# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
203# endif
204# if __has_feature(is_abstract)
205# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
206# endif
207# if __has_feature(is_base_of)
208# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
209# endif
210# if __has_feature(is_class)
211# define BOOST_IS_CLASS(T) __is_class(T)
212# endif
213# if __has_feature(is_convertible_to)
214# define BOOST_IS_CONVERTIBLE(T,U) __is_convertible_to(T,U)
215# endif
216# if __has_feature(is_enum)
217# define BOOST_IS_ENUM(T) __is_enum(T)
218# endif
219# if __has_feature(is_polymorphic)
220# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
221# endif
222# if __has_feature(has_trivial_move_constructor)
223# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__has_trivial_move_constructor(T) && is_constructible<T, T&&>::value && !::boost::is_volatile<T>::value)
224# endif
225# if __has_feature(has_trivial_move_assign)
226# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__has_trivial_move_assign(T) && is_assignable<T&, T&&>::value && !::boost::is_volatile<T>::value)
227# endif
228# if (!defined(unix) && !defined(__unix__)) || defined(__LP64__) || !defined(__GNUC__)
229// GCC sometimes lies about alignment requirements
230// of type double on 32-bit unix platforms, use the
231// old implementation instead in that case:
232# define BOOST_ALIGNMENT_OF(T) __alignof(T)
233# endif
234# if __has_feature(is_final)
235# define BOOST_IS_FINAL(T) __is_final(T)
236# endif
237
238# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
239#endif
240
241#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__))) && !defined(BOOST_CLANG)
242//
243// Note that even though these intrinsics rely on other type traits classes
244// we do not #include those here as it produces cyclic dependencies and
245// can cause the intrinsics to not even be used at all!
246//
247
248#ifdef BOOST_INTEL
249# define BOOST_INTEL_TT_OPTS || is_pod<T>::value
250#else
251# define BOOST_INTEL_TT_OPTS
252#endif
253
254# define BOOST_IS_UNION(T) __is_union(T)
255# define BOOST_IS_POD(T) __is_pod(T)
256# define BOOST_IS_EMPTY(T) __is_empty(T)
257# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ((__has_trivial_constructor(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value)
258# define BOOST_HAS_TRIVIAL_COPY(T) ((__has_trivial_copy(T) BOOST_INTEL_TT_OPTS) && !is_reference<T>::value)
259#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409
260# 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)
261# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS && is_destructible<T>::value)
262# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value BOOST_INTEL_TT_OPTS)
263# 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)
264# 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)
265#else
266# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value)
267# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS)
268# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) BOOST_INTEL_TT_OPTS)
269# 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)
270# 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)
271#endif
272# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
273
274# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
275# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
276# define BOOST_IS_CLASS(T) __is_class(T)
277# define BOOST_IS_ENUM(T) __is_enum(T)
278# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
279# if (!defined(unix) && !defined(__unix__)) || defined(__LP64__)
280 // GCC sometimes lies about alignment requirements
281 // of type double on 32-bit unix platforms, use the
282 // old implementation instead in that case:
283# define BOOST_ALIGNMENT_OF(T) __alignof__(T)
284# endif
285# if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))
286# define BOOST_IS_FINAL(T) __is_final(T)
287# endif
288
289# if (__GNUC__ >= 5) && (__cplusplus >= 201103)
290# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__is_trivially_assignable(T&, T&&) && is_assignable<T&, T&&>::value && !::boost::is_volatile<T>::value)
291# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__is_trivially_constructible(T, T&&) && is_constructible<T, T&&>::value && !::boost::is_volatile<T>::value)
292# endif
293
294# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
295#endif
296
297#if defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)
298# define BOOST_IS_UNION(T) __oracle_is_union(T)
299# define BOOST_IS_POD(T) (__oracle_is_pod(T) && !is_function<T>::value)
300# define BOOST_IS_EMPTY(T) __oracle_is_empty(T)
301# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__oracle_has_trivial_constructor(T) && ! ::boost::is_volatile<T>::value)
302# define BOOST_HAS_TRIVIAL_COPY(T) (__oracle_has_trivial_copy(T) && !is_reference<T>::value)
303# 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)
304# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__oracle_has_trivial_destructor(T) && is_destructible<T>::value)
305# 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)
306// __oracle_has_nothrow_copy appears to behave the same as __oracle_has_nothrow_assign, disabled for now:
307//# 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)
308# 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)
309# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __oracle_has_virtual_destructor(T)
310
311# define BOOST_IS_ABSTRACT(T) __oracle_is_abstract(T)
312//# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
313# define BOOST_IS_CLASS(T) __oracle_is_class(T)
314# define BOOST_IS_ENUM(T) __oracle_is_enum(T)
315# define BOOST_IS_POLYMORPHIC(T) __oracle_is_polymorphic(T)
316# define BOOST_ALIGNMENT_OF(T) __alignof__(T)
317# define BOOST_IS_FINAL(T) __oracle_is_final(T)
318
319# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
320#endif
321
322#if defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600)
323# include <boost/type_traits/is_same.hpp>
324# include <boost/type_traits/is_reference.hpp>
325# include <boost/type_traits/is_volatile.hpp>
326
327# define BOOST_IS_UNION(T) __is_union(T)
328# define BOOST_IS_POD(T) __is_pod(T)
329# define BOOST_IS_EMPTY(T) __is_empty(T)
330# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
331# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
332# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
333# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
334# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
335# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value)
336# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
337# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
338
339# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
340# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
341# define BOOST_IS_CLASS(T) __is_class(T)
342# define BOOST_IS_ENUM(T) __is_enum(T)
343# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
344# define BOOST_ALIGNMENT_OF(T) __alignof__(T)
345# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
346#endif
347
348# if defined(__CODEGEARC__)
349# include <boost/type_traits/is_same.hpp>
350# include <boost/type_traits/is_reference.hpp>
351# include <boost/type_traits/is_volatile.hpp>
352# include <boost/type_traits/is_void.hpp>
353
354# define BOOST_IS_UNION(T) __is_union(T)
355# define BOOST_IS_POD(T) __is_pod(T)
356# define BOOST_IS_EMPTY(T) __is_empty(T)
357# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T))
358# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_reference<T>::value)
359# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
360# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T))
361# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T))
362# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value)
363# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
364# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
365
366# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
367# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_void<T>::value && !is_void<U>::value)
368# define BOOST_IS_CLASS(T) __is_class(T)
369# define BOOST_IS_CONVERTIBLE(T,U) (__is_convertible(T,U) || is_void<U>::value)
370# define BOOST_IS_ENUM(T) __is_enum(T)
371# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
372# define BOOST_ALIGNMENT_OF(T) alignof(T)
373
374# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
375#endif
376
377#endif // BOOST_TT_DISABLE_INTRINSICS
378
379#endif // BOOST_TT_INTRINSICS_HPP_INCLUDED
380
381

source code of boost/boost/type_traits/intrinsics.hpp