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