2 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
3 // Permission to copy, use, modify, sell and distribute this software is
4 // granted provided this copyright notice appears in all copies. This software
5 // is provided "as is" without express or implied warranty, and with no claim
6 // as to its suitability for any purpose.
8 // See http://www.boost.org for most recent version including documentation.
10 #ifndef BOOST_TT_CONFIG_HPP_INCLUDED
11 #define BOOST_TT_CONFIG_HPP_INCLUDED
13 #ifndef BOOST_CONFIG_HPP
14 #include "boost/config.hpp"
18 // Helper macros for builtin compiler support.
19 // If your compiler has builtin support for any of the following
20 // traits concepts, then redefine the appropriate macros to pick
21 // up on the compiler support:
23 // (these should largely ignore cv-qualifiers)
24 // BOOST_IS_CLASS(T) should evaluate to true if T is a class or struct type
25 // BOOST_IS_ENUM(T) should evaluate to true if T is an enumerator type
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 struct or 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_ASSIGN(T) should evaluate to true if t = u <==> memcpy
32 // BOOST_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect
34 #ifdef BOOST_HAS_SGI_TYPE_TRAITS
35 # include "boost/type_traits/is_same.hpp"
36 # include <type_traits.h>
37 # define BOOST_IS_POD(T) ::boost::is_same< typename ::__type_traits<T>::is_POD_type, ::__true_type>::value
38 # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_default_constructor, ::__true_type>::value
39 # define BOOST_HAS_TRIVIAL_COPY(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_copy_constructor, ::__true_type>::value
40 # define BOOST_HAS_TRIVIAL_ASSIGN(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_assignment_operator, ::__true_type>::value
41 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_destructor, ::__true_type>::value
44 #ifndef BOOST_IS_CLASS
45 # define BOOST_IS_CLASS(T) false
49 # define BOOST_IS_ENUM(T) false
52 #ifndef BOOST_IS_UNION
53 # define BOOST_IS_UNION(T) false
57 # define BOOST_IS_POD(T) false
60 #ifndef BOOST_IS_EMPTY
61 # define BOOST_IS_EMPTY(T) false
64 #ifndef BOOST_HAS_TRIVIAL_CONSTRUCTOR
65 # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) false
68 #ifndef BOOST_HAS_TRIVIAL_COPY
69 # define BOOST_HAS_TRIVIAL_COPY(T) false
72 #ifndef BOOST_HAS_TRIVIAL_ASSIGN
73 # define BOOST_HAS_TRIVIAL_ASSIGN(T) false
76 #ifndef BOOST_HAS_TRIVIAL_DESTRUCTOR
77 # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false
81 // whenever we have a conversion function with elipses
82 // it needs to be declared __cdecl to suppress compiler
83 // warnings from MS and Borland compilers:
84 #if defined(BOOST_MSVC) || defined(__BORLANDC__)
85 # define BOOST_TT_DECL __cdecl
87 # define BOOST_TT_DECL /**/
90 # if (defined(__MWERKS__) && __MWERKS__ >= 0x3000) || BOOST_MSVC > 1301 || defined(BOOST_NO_COMPILER_CONFIG)
91 # define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION
94 #endif // BOOST_TT_CONFIG_HPP_INCLUDED