]> git.lyx.org Git - lyx.git/blob - boost/boost/type_traits/fwd.hpp
update boost
[lyx.git] / boost / boost / type_traits / fwd.hpp
1 //  (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
2 //  Permission to copy, use, modify, sell and
3 //  distribute this software is granted provided this copyright notice appears
4 //  in all copies. This software is provided "as is" without express or implied
5 //  warranty, and with no claim as to its suitability for any purpose.
6 //
7 //  See http://www.boost.org for most recent version including documentation.
8 //
9 //  forward declarations of type_traits classes
10 //
11 #ifndef BOOST_FWD_TYPE_TRAITS_HPP
12 #define BOOST_FWD_TYPE_TRAITS_HPP
13
14 #include <cstdlib>
15 #include <cstddef>
16
17 #ifndef BOOST_CONFIG_HPP
18 #include <boost/config.hpp>
19 #endif
20
21 //
22 // Helper macros for builtin compiler support.
23 // If your compiler has builtin support for any of the following
24 // traits concepts, then redefine the appropriate macros to pick
25 // up on the compiler support:
26 //
27 // (these should largely ignore cv-qualifiers)
28 // BOOST_IS_CLASS(T) should evaluate to true if T is a class or struct type
29 // BOOST_IS_ENUM(T) should evaluate to true if T is an enumerator type
30 // BOOST_IS_UNION(T) should evaluate to true if T is a union type
31 // BOOST_IS_POD(T) should evaluate to true if T is a POD type
32 // BOOST_IS_EMPTY(T) should evaluate to true if T is an empty struct or union
33 // BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) should evaluate to true if "T x;" has no effect
34 // BOOST_HAS_TRIVIAL_COPY(T) should evaluate to true if T(t) <==> memcpy
35 // BOOST_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy
36 // BOOST_HAS_TRIVIAL_DESTRUCTOR(T) should evaluate to true if ~T() has no effect
37
38 #ifdef BOOST_HAS_SGI_TYPE_TRAITS
39 #  define BOOST_IS_POD(T) ::boost::is_same< typename ::__type_traits<T>::is_POD_type, ::__true_type>::value
40 #  define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_default_constructor, ::__true_type>::value
41 #  define BOOST_HAS_TRIVIAL_COPY(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_copy_constructor, ::__true_type>::value
42 #  define BOOST_HAS_TRIVIAL_ASSIGN(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_assignment_operator, ::__true_type>::value
43 #  define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) ::boost::is_same< typename ::__type_traits<T>::has_trivial_destructor, ::__true_type>::value
44 #endif
45
46 #ifndef BOOST_IS_CLASS
47 #  define BOOST_IS_CLASS(T) false
48 #endif
49
50 #ifndef BOOST_IS_ENUM
51 #  define BOOST_IS_ENUM(T) false
52 #endif
53
54 #ifndef BOOST_IS_UNION
55 #  define BOOST_IS_UNION(T) false
56 #endif
57
58 #ifndef BOOST_IS_POD
59 #  define BOOST_IS_POD(T) false
60 #endif
61
62 #ifndef BOOST_IS_EMPTY
63 #  define BOOST_IS_EMPTY(T) false
64 #endif
65
66 #ifndef BOOST_HAS_TRIVIAL_CONSTRUCTOR
67 #  define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) false
68 #endif
69
70 #ifndef BOOST_HAS_TRIVIAL_COPY
71 #  define BOOST_HAS_TRIVIAL_COPY(T) false
72 #endif
73
74 #ifndef BOOST_HAS_TRIVIAL_ASSIGN
75 #  define BOOST_HAS_TRIVIAL_ASSIGN(T) false
76 #endif
77
78 #ifndef BOOST_HAS_TRIVIAL_DESTRUCTOR
79 #  define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false
80 #endif
81
82 //
83 // whenever we have a conversion function with elipses
84 // it needs to be declared __cdecl to suppress compiler
85 // warnings from MS and Borland compilers:
86 #if defined(BOOST_MSVC) || defined(__BORLANDC__)
87 #define BOOST_TT_DECL __cdecl
88 #else
89 #define BOOST_TT_DECL
90 #endif
91
92
93 namespace boost{
94 //
95 // forward declare all type traits templates here
96 //
97 // conversion_traits.hpp:
98 template <class From, class To>
99 struct is_convertible;
100 // alignment_traits.hpp:
101 template <class T>
102 struct alignment_of;
103 // arithmetic_traits.hpp:
104 template <class T>
105 struct is_void;
106 template <class T>
107 struct is_integral;
108 template <class T>
109 struct is_float;
110 template <class T>
111 struct is_arithmetic;
112 template <class T>
113 struct is_fundamental;
114
115 // cv_traits.hpp:
116 template <class T>
117 struct is_const;
118 template <class T>
119 struct is_volatile;
120 template <class T>
121 struct remove_const;
122 template <class T>
123 struct remove_volatile;
124 template <class T>
125 struct remove_cv;
126 template <class T>
127 struct add_const;
128 template <class T>
129 struct add_volatile;
130 template <class T>
131 struct add_cv;
132
133 // composite_traits.hpp:
134 template <class T>
135 struct is_array;
136 template <class T>
137 struct is_pointer;
138 template <class T>
139 struct is_reference;
140 template <class T>
141 struct is_member_pointer;
142 template <class T>
143 struct is_member_function_pointer;
144 template <class T>
145 struct is_enum;
146 template <class T>
147 struct is_union;
148
149 // object_traits.hpp:
150 template <class T>
151 struct is_object;
152 template <class T>
153 struct is_scalar;
154 template <class T>
155 struct is_class;
156 template <class T>
157 struct is_compound;
158 template <class T>
159 struct is_POD;
160 template <class T>
161 struct has_trivial_constructor;
162 template <class T>
163 struct has_trivial_copy;
164 template <class T>
165 struct has_trivial_assign;
166 template <class T>
167 struct has_trivial_destructor;
168 template <class T>
169 struct has_nothrow_constructor;
170 template <class T>
171 struct has_nothrow_copy;
172 template <class T>
173 struct has_nothrow_assign;
174 template <class T>
175 struct is_empty;
176 template <class Base, class Derived>
177 struct is_base_and_derived;
178
179 // transform_traits.hpp:
180 template <class T>
181 struct remove_reference;
182 template <class T>
183 struct add_reference;
184 template <class T>
185 struct remove_bounds;
186 template <class T>
187 struct remove_pointer;
188 template <class T>
189 struct add_pointer;
190
191 // same_traits.hpp:
192 template <class T, class U>
193 struct is_same;
194
195 } // namespace boost
196
197 #endif // BOOST_FWD_TYPE_TRAITS_HPP
198
199
200
201