]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/boost/typeof/typeof.hpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / boost / typeof / typeof.hpp
1 // Copyright (C) 2004 Arkadiy Vertleyb
2 // Distributed under the Boost Software License, Version 1.0. (See accompanying
3 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
4
5 #ifndef BOOST_TYPEOF_TYPEOF_HPP_INCLUDED
6 #define BOOST_TYPEOF_TYPEOF_HPP_INCLUDED
7
8 #if defined(BOOST_TYPEOF_COMPLIANT)
9 # define BOOST_TYPEOF_EMULATION
10 #endif
11
12 #if defined(BOOST_TYPEOF_EMULATION) && defined(BOOST_TYPEOF_NATIVE)
13 # error both typeof emulation and native mode requested
14 #endif
15
16 #include <boost/config.hpp>
17
18 #if !defined(BOOST_NO_CXX11_DECLTYPE) && !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES) && !defined(BOOST_TYPEOF_EMULATION)
19 # define BOOST_TYPEOF_DECLTYPE
20 # ifndef BOOST_TYPEOF_NATIVE
21 # define BOOST_TYPEOF_NATIVE
22 # endif
23
24 #elif defined(__COMO__)
25 # ifdef __GNUG__
26 # ifndef BOOST_TYPEOF_EMULATION
27 # ifndef BOOST_TYPEOF_NATIVE
28 # define BOOST_TYPEOF_NATIVE
29 # endif
30 # define BOOST_TYPEOF_KEYWORD typeof
31 # endif
32 # else
33 # ifndef BOOST_TYPEOF_NATIVE
34 # ifndef BOOST_TYPEOF_EMULATION
35 # define BOOST_TYPEOF_EMULATION
36 # endif
37 # else
38 # error native typeof is not supported
39 # endif
40 # endif
41
42 #elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
43 # ifdef __GNUC__
44 # ifndef BOOST_TYPEOF_EMULATION
45 # ifndef BOOST_TYPEOF_NATIVE
46 # define BOOST_TYPEOF_NATIVE
47 # endif
48 # define BOOST_TYPEOF_KEYWORD __typeof__
49 # endif
50 # else
51 # ifndef BOOST_TYPEOF_NATIVE
52 # ifndef BOOST_TYPEOF_EMULATION
53 # define BOOST_TYPEOF_EMULATION
54 # endif
55 # else
56 # error native typeof is not supported
57 # endif
58 # endif
59
60 #elif defined(__GNUC__) || defined(__clang__)
61 # ifndef BOOST_TYPEOF_EMULATION
62 # ifndef BOOST_TYPEOF_NATIVE
63 # define BOOST_TYPEOF_NATIVE
64 # endif
65 # define BOOST_TYPEOF_KEYWORD __typeof__
66 # endif
67
68 #elif defined(__MWERKS__)
69 # if(__MWERKS__ <= 0x3003) // 8.x
70 # ifndef BOOST_TYPEOF_EMULATION
71 # ifndef BOOST_TYPEOF_NATIVE
72 # define BOOST_TYPEOF_NATIVE
73 # endif
74 # define BOOST_TYPEOF_KEYWORD __typeof__
75 # else
76 # define BOOST_TYPEOF_EMULATION_UNSUPPORTED
77 # endif
78 # else // 9.x
79 # ifndef BOOST_TYPEOF_EMULATION
80 # ifndef BOOST_TYPEOF_NATIVE
81 # define BOOST_TYPEOF_NATIVE
82 # endif
83 # define BOOST_TYPEOF_KEYWORD __typeof__
84 # endif
85 # endif
86 #elif defined __CODEGEARC__
87 # ifndef BOOST_TYPEOF_EMULATION
88 # ifndef BOOST_TYPEOF_NATIVE
89 # define BOOST_TYPEOF_EMULATION_UNSUPPORTED
90 # endif
91 # else
92 # define BOOST_TYPEOF_EMULATION_UNSUPPORTED
93 # endif
94 #elif defined __BORLANDC__
95 # ifndef BOOST_TYPEOF_EMULATION
96 # ifndef BOOST_TYPEOF_NATIVE
97 # define BOOST_TYPEOF_EMULATION_UNSUPPORTED
98 # endif
99 # else
100 # define BOOST_TYPEOF_EMULATION_UNSUPPORTED
101 # endif
102 #elif defined __DMC__
103 # ifndef BOOST_TYPEOF_EMULATION
104 # ifndef BOOST_TYPEOF_NATIVE
105 # define BOOST_TYPEOF_NATIVE
106 # endif
107 # include <boost/typeof/dmc/typeof_impl.hpp>
108 # define MSVC_TYPEOF_HACK
109 # endif
110 #elif defined(_MSC_VER)
111 # if (_MSC_VER >= 1310) // 7.1 ->
112 # ifndef BOOST_TYPEOF_EMULATION
113 # ifndef BOOST_TYPEOF_NATIVE
114 # ifndef _MSC_EXTENSIONS
115 # define BOOST_TYPEOF_EMULATION
116 # else
117 # define BOOST_TYPEOF_NATIVE
118 # endif
119 # endif
120 # endif
121 # ifdef BOOST_TYPEOF_NATIVE
122 # include <boost/typeof/msvc/typeof_impl.hpp>
123 # define MSVC_TYPEOF_HACK
124 # endif
125 # endif
126 #elif defined(__HP_aCC)
127 # ifndef BOOST_TYPEOF_NATIVE
128 # ifndef BOOST_TYPEOF_EMULATION
129 # define BOOST_TYPEOF_EMULATION
130 # endif
131 # else
132 # error native typeof is not supported
133 # endif
134
135 #elif defined(__DECCXX)
136 # ifndef BOOST_TYPEOF_NATIVE
137 # ifndef BOOST_TYPEOF_EMULATION
138 # define BOOST_TYPEOF_EMULATION
139 # endif
140 # else
141 # error native typeof is not supported
142 # endif
143
144 #elif defined(__BORLANDC__)
145 # if (__BORLANDC__ < 0x590)
146 # define BOOST_TYPEOF_NO_FUNCTION_TYPES
147 # define BOOST_TYPEOF_NO_MEMBER_FUNCTION_TYPES
148 # endif
149 # ifndef BOOST_TYPEOF_NATIVE
150 # ifndef BOOST_TYPEOF_EMULATION
151 # define BOOST_TYPEOF_EMULATION
152 # endif
153 # else
154 # error native typeof is not supported
155 # endif
156 #elif defined(__SUNPRO_CC)
157 # if (__SUNPRO_CC < 0x590 )
158 # ifdef BOOST_TYPEOF_NATIVE
159 # error native typeof is not supported
160 # endif
161 # ifndef BOOST_TYPEOF_EMULATION
162 # define BOOST_TYPEOF_EMULATION
163 # endif
164 # else
165 # ifndef BOOST_TYPEOF_EMULATION
166 # ifndef BOOST_TYPEOF_NATIVE
167 # define BOOST_TYPEOF_NATIVE
168 # endif
169 # define BOOST_TYPEOF_KEYWORD __typeof__
170 # endif
171 # endif
172 #elif defined(__IBM__TYPEOF__)
173 # ifndef BOOST_TYPEOF_EMULATION
174 # ifndef BOOST_TYPEOF_NATIVE
175 # define BOOST_TYPEOF_NATIVE
176 # endif
177 # define BOOST_TYPEOF_KEYWORD __typeof__
178 # endif
179 #else //unknown compiler
180 # ifndef BOOST_TYPEOF_NATIVE
181 # ifndef BOOST_TYPEOF_EMULATION
182 # define BOOST_TYPEOF_EMULATION
183 # endif
184 # else
185 # ifndef BOOST_TYPEOF_KEYWORD
186 # define BOOST_TYPEOF_KEYWORD typeof
187 # endif
188 # endif
189
190 #endif
191
192 #define BOOST_TYPEOF_UNIQUE_ID()\
193 BOOST_TYPEOF_REGISTRATION_GROUP * 0x10000 + __LINE__
194
195 #define BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()\
196 <boost/typeof/incr_registration_group.hpp>
197
198 #ifdef BOOST_TYPEOF_EMULATION_UNSUPPORTED
199 # include <boost/typeof/unsupported.hpp>
200 #elif defined BOOST_TYPEOF_EMULATION
201 # define BOOST_TYPEOF_TEXT "using typeof emulation"
202 # include <boost/typeof/message.hpp>
203 # include <boost/typeof/typeof_impl.hpp>
204 # include <boost/typeof/type_encoding.hpp>
205 # include <boost/typeof/template_encoding.hpp>
206 # include <boost/typeof/modifiers.hpp>
207 # include <boost/typeof/pointers_data_members.hpp>
208 # include <boost/typeof/register_functions.hpp>
209 # include <boost/typeof/register_fundamental.hpp>
210
211 #elif defined(BOOST_TYPEOF_NATIVE)
212 # define BOOST_TYPEOF_TEXT "using native typeof"
213 # include <boost/typeof/message.hpp>
214 # ifdef BOOST_TYPEOF_DECLTYPE
215 # include <boost/typeof/decltype.hpp>
216 # else
217 # include <boost/typeof/native.hpp>
218 # endif
219 #else
220 # error typeof configuration error
221 #endif
222
223 // auto
224 #define BOOST_AUTO(Var, Expr) BOOST_TYPEOF(Expr) Var = Expr
225 #define BOOST_AUTO_TPL(Var, Expr) BOOST_TYPEOF_TPL(Expr) Var = Expr
226
227 #endif//BOOST_TYPEOF_TYPEOF_HPP_INCLUDED