Imported Upstream version 1.72.0
[platform/upstream/boost.git] / libs / config / doc / macro_reference.qbk
1 [/
2     Boost.Config
3
4     Copyright (c) 2001 Beman Dawes
5     Copyright (c) 2001 Vesa Karvonen
6     Copyright (c) 2001 John Maddock
7
8     Distributed under the Boost Software License, Version 1.0.
9     (See accompanying file LICENSE_1_0.txt or copy at
10     http://www.boost.org/LICENSE_1_0.txt)
11 ]
12
13
14
15 [section Boost Macro Reference]
16
17 [#config_defects]
18
19 [section Macros that describe C++03 defects]
20
21 The following macros all describe features that are required by the C++03 standard,
22 if one of the following macros is defined, then it represents a defect in the
23 compiler's conformance with the 2003 standard.
24
25
26 [table
27 [[Macro        ][Section     ][ Description          ]]
28
29
30 [[`BOOST_BCB_PARTIAL_SPECIALIZATION_BUG`][Compiler][
31 The compiler exhibits certain partial specialisation bug - probably Borland
32 C++ Builder specific.
33 ]]
34 [[`BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL`][Compiler][
35 Argument dependent lookup fails if there is a using declaration for the
36 symbol being looked up in the current scope.  For example, using
37 `boost::get_pointer`; prevents ADL from finding overloads of `get_pointer`
38 in namespaces nested inside boost (but not elsewhere).  Probably
39 Borland specific.
40 ]]
41 [[`BOOST_NO_ADL_BARRIER`][Compiler][
42 The compiler locates and searches namespaces that it should /*not*/ in fact 
43 search when performing argument dependent lookup.
44 ]]
45 [[`BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP`][Compiler][
46 Compiler does not implement argument-dependent lookup (also named
47 Koenig lookup); see std::3.4.2 \[basic.koenig.lookup\]
48 ]]
49 [[`BOOST_NO_AUTO_PTR`][Standard library][
50 If the compiler / library supplies non-standard or broken `std::auto_ptr`.
51 ]]
52 [[`BOOST_NO_COMPLETE_VALUE_INITIALIZATION`][Compiler][ 
53 Compiler has not completely implemented value-initialization. 
54 See also [@../../../utility/value_init.htm#compiler_issues The Utility\/Value Init docs] 
55 ]] 
56 [[`BOOST_NO_CTYPE_FUNCTIONS`][Platform][
57 The Platform does not provide functions for the character-classifying
58 operations `<ctype.h>` and `<cctype>`, only macros.
59 ]]
60 [[`BOOST_NO_CV_SPECIALIZATIONS`][Compiler][
61 If template specialisations for cv-qualified types conflict with a
62 specialisation for a cv-unqualififed type.
63 ]]
64 [[`BOOST_NO_CV_VOID_SPECIALIZATIONS`][Compiler][
65 If template specialisations for cv-void types conflict with a specialisation
66 for void.
67 ]]
68 [[`BOOST_NO_CWCHAR`][Platform][
69 The Platform does not provide `<wchar.h>` and `<cwchar>`.
70 ]]
71 [[`BOOST_NO_CWCTYPE`][Platform][
72 The Platform does not provide `<wctype.h>` and `<cwctype>`.
73 ]]
74 [[`BOOST_NO_FENV_H`][Platform, Standard library][
75 The C standard library doesn't provide `<fenv.h>`. [@../../../../boost/detail/fenv.hpp
76 `<boost/detail/fenv.hpp>`] should be included instead of `<fenv.h>` for maximum
77 portability on platforms which do provide `<fenv.h>`. 
78 ]]
79 [[`BOOST_NO_DEPENDENT_NESTED_DERIVATIONS`][Compiler][
80 The compiler fails to compile a nested class that has a dependent base class:
81 ``
82 template<typename T>
83 struct foo : {
84    template<typename U>
85    struct bar : public U {};
86 ``
87 };
88 ]]
89 [[`BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS`][Compiler][
90 Template value parameters cannot have a dependent type, for example:
91 ``
92 template<class T, typename T::type value> 
93 class X { ... };
94 ``
95 ]]
96 [[`BOOST_NO_EXCEPTION_STD_NAMESPACE`][Standard Library][
97 The standard library does not put some or all of the contents of
98 `<exception>` in namespace std.
99 ]]
100 [[`BOOST_NO_EXCEPTIONS`][Compiler][
101 The compiler does not support exception handling (this setting is typically
102 required by many C++ compilers for embedded platforms). Note that there is
103 no requirement for boost libraries to honor this configuration setting -
104 indeed doing so may be impossible in some cases. Those libraries that do
105 honor this will typically abort if a critical error occurs - you have been
106 warned!
107 ]]
108 [[`BOOST_NO_FUNCTION_TEMPLATE_ORDERING`][Compiler][
109 The compiler does not perform function template ordering or its function
110 template ordering is incorrect.
111 ``
112 // #1
113 template<class T> void f(T);
114
115 // #2
116 template<class T,class U> void f(T(*)(U));
117
118 void bar(int);
119
120 f(&bar); // should choose #2.
121 ``
122 ]]
123 [[`BOOST_NO_INCLASS_MEMBER_INITIALIZATION`][Compiler][
124 Compiler violates std::9.4.2/4.
125 ]]
126 [[`BOOST_NO_INTRINSIC_WCHAR_T`][Compiler][
127 The C++ implementation does not provide `wchar_t`, or it is really a synonym
128 for another integral type. Use this symbol to decide whether it is appropriate
129 to explicitly specialize a template on `wchar_t` if there is already a
130 specialization for other integer types.
131 ]]
132 [[`BOOST_NO_IOSFWD`][std lib][
133 The standard library lacks `<iosfwd>`.
134 ]]
135 [[`BOOST_NO_IOSTREAM`][std lib][
136 The standard library lacks `<iostream>`, `<istream>` or `<ostream>`.
137 ]]
138 [[`BOOST_NO_IS_ABSTRACT`][Compiler][
139 The C++ compiler does not support SFINAE with abstract types, this is covered
140 by __CORE_LANGUAGE_DR337__, but is not part of the current standard.  Fortunately
141 most compilers that support SFINAE also support this DR.  See also BOOST_NO_SFINAE and BOOST_NO_SFINAE_EXPR
142 ]]
143 [[`BOOST_NO_LIMITS`][Standard library][
144 The C++ implementation does not provide the `<limits>` header. Never check for
145 this symbol in library code; always include `<boost/limits.hpp>`, which
146 guarantees to provide `std::numeric_limits`.
147 ]]
148 [[`BOOST_NO_CXX11_NUMERIC_LIMITS`][Standard library][
149 C++11 additions to `std::numeric_limits` are not available for use.
150 `static function numeric_limits<T>::lowest()` the lowest finite value representable by the numeric type.
151 `static int const max_digits10` the number of decimal digits that are required to make sure that two distinct values of the type have distinct decimal representations.
152 `template<> class numeric_limits<char16_t>;`, see also `BOOST_NO_CXX11_CHAR16_T`, 
153 `template<> class numeric_limits<char32_t>;` see also `BOOST_NO_CXX11_CHAR32_T`.
154 Replaces BOOST_NO_NUMERIC_LIMITS_LOWEST.
155 ]]
156 [[`BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS`][Standard library][
157 Constants such as `numeric_limits<T>::is_signed` are not available for use
158 at compile-time.
159 ]]
160 [[`BOOST_NO_LONG_LONG_NUMERIC_LIMITS`][Standard library][
161 There is no specialization for `numeric_limits<long long>` and
162 `numeric_limits<unsigned long long>`. `<boost/limits.hpp>` will then add these
163 specializations as a standard library "fix" only if the compiler supports the
164 `long long` datatype.
165 ]]
166 [[`BOOST_NO_MEMBER_FUNCTION_SPECIALIZATIONS`][Compiler][
167 The compiler does not support the specialization of individual member
168 functions of template classes.
169 ]]
170 [[`BOOST_NO_MEMBER_TEMPLATE_KEYWORD`][Compiler][
171 If the compiler supports member templates, but not the template keyword
172 when accessing member template classes.
173 ]]
174 [[`BOOST_NO_MEMBER_TEMPLATE_FRIENDS`][Compiler][
175 Member template friend syntax (`template<class P> friend class frd;`)
176 described in the C++ Standard, 14.5.3, not supported.
177 ]]
178 [[`BOOST_NO_MEMBER_TEMPLATES`][Compiler][
179 Member template functions not fully supported.
180 ]]
181 [[`BOOST_NO_MS_INT64_NUMERIC_LIMITS`][Standard library][
182 There is no specialization for `numeric_limits<__int64>` and
183 `numeric_limits<unsigned __int64>`. `<boost/limits.hpp>` will then add these
184 specializations as a standard library "fix", only if the compiler supports
185 the `__int64` datatype.
186 ]]
187 [[`BOOST_NO_NESTED_FRIENDSHIP`][Compiler][
188 Compiler doesn't allow a nested class to access private members of its
189 containing class. Probably Borland/CodeGear specific.
190 ]]
191 [[`BOOST_NO_OPERATORS_IN_NAMESPACE`][Compiler][
192 Compiler requires inherited operator friend functions to be defined at
193 namespace scope, then using'ed to boost. Probably GCC specific. See
194 [@../../../../boost/operators.hpp `<boost/operators.hpp>`] for example.
195 ]]
196 [[`BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS`][Compiler][
197 The compiler does not correctly handle partial specializations
198 which depend upon default arguments in the primary template.
199 ]]
200 [[`BOOST_NO_POINTER_TO_MEMBER_CONST`][Compiler][
201 The compiler does not correctly handle pointers to const member functions,
202 preventing use of these in overloaded function templates. See
203 [@../../../../boost/functional.hpp `<boost/functional.hpp>`] for example.
204 ]]
205 [[`BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS`][Compiler][
206 Pointers to members don't work when used as template parameters.
207 ]]
208 [[`BOOST_NO_PRIVATE_IN_AGGREGATE`][Compiler][
209 The compiler misreads 8.5.1, treating classes as non-aggregate if they
210 contain private or protected member functions.
211 ]]
212 [[`BOOST_NO_RESTRICT_REFERENCES`][Compiler][
213 Compiler-specific `restrict` keyword can not be applied to references.
214 ]]
215 [[`BOOST_NO_RTTI`][Compiler][
216 The compiler may (or may not) have the typeid operator, but RTTI on the dynamic type
217 of an object is not supported.
218 ]]
219 [[`BOOST_NO_SFINAE`][Compiler][
220 The compiler does not support the "Substitution Failure Is Not An Error"
221 meta-programming idiom.  This is the lightweight pre-C++11 version of SFINAE.
222 ]]
223 [[`BOOST_NO_SFINAE_EXPR`][Compiler][
224 The compiler does not support usage of SFINAE with arbitrary expressions.  This is the
225 post-C++11 SFINAE, but excludes a few specific corner cases, see also BOOST_NO_CXX11_SFINAE_EXPR.
226 ]]
227 [[`BOOST_NO_STD_ALLOCATOR`][Standard library][
228 The C++ standard library does not provide a standards conforming
229 `std::allocator`.
230 ]]
231 [[`BOOST_NO_STD_DISTANCE`][Standard library][
232 The platform does not have a conforming version of `std::distance`.
233 ]]
234 [[`BOOST_NO_STD_ITERATOR`][Standard library][
235 The C++ implementation fails to provide the `std::iterator` class.  
236 Note that post C++17, this macro is re-purposed to indicate that std::iterator has been removed or deprecated.
237 ]]
238 [[`BOOST_NO_STD_ITERATOR_TRAITS`][Standard library][
239 The compiler does not provide a standard compliant implementation of
240 `std::iterator_traits`. Note that the compiler may still have a
241 non-standard implementation.
242 ]]
243 [[`BOOST_NO_STD_LOCALE`][Standard library][
244 The standard library lacks `std::locale`.
245 ]]
246 [[`BOOST_NO_STD_MESSAGES`][Standard library][
247 The standard library lacks a conforming `std::messages` facet.
248 ]]
249 [[`BOOST_NO_STD_MIN_MAX`][Standard library][
250 The C++ standard library does not provide the `min()` and `max()` template
251 functions that should be in `<algorithm>`.
252 ]]
253 [[`BOOST_NO_STD_OUTPUT_ITERATOR_ASSIGN`][Standard library][
254 Defined if the standard library's output iterators are not assignable.
255 ]]
256 [[`BOOST_NO_STD_TYPEINFO`][Standard library][
257 The <typeinfo> header declares `type_info` in the global namespace instead of namespace std.
258 ]]
259 [[`BOOST_NO_STD_USE_FACET`][Standard library][
260 The standard library lacks a conforming `std::use_facet`.
261 ]]
262 [[`BOOST_NO_STD_WSTREAMBUF`][Standard library][
263 The standard library's implementation of `std::basic_streambuf<wchar_t>`
264 is either missing, incomplete, or buggy.
265 ]]
266 [[`BOOST_NO_STD_WSTRING`][Standard library][
267 The standard library lacks `std::wstring`.
268 ]]
269 [[`BOOST_NO_STDC_NAMESPACE`][Compiler, Platform][
270 The contents of C++ standard headers for C library functions
271 (the `<c...>` headers) have not been placed in namespace std. This test is
272 difficult - some libraries "fake" the std C functions by adding using
273 declarations to import them into namespace std, unfortunately they don't
274 necessarily catch all of them...
275 ]]
276 [[`BOOST_NO_STRINGSTREAM`][Standard library][
277 The C++ implementation does not provide the `<sstream>` header.
278 ]]
279 [[`BOOST_NO_SWPRINTF`][Platform][
280 The platform does not have a conforming version of `swprintf`.
281 ]]
282 [[`BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION`][Compiler][
283 Class template partial specialization (14.5.4 \[temp.class.spec\]) not
284 supported.
285 ]]
286 [[`BOOST_NO_TEMPLATED_IOSTREAMS`][Standard library][
287 The standard library does not provide templated iostream classes.
288 ]]
289 [[`BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS`][Standard library][
290 The standard library does not provide templated iterator constructors
291 for its containers.
292 ]]
293 [[`BOOST_NO_TEMPLATE_TEMPLATES`][Compiler][
294 The compiler does not support template template parameters.
295 ]]
296 [[`BOOST_NO_TYPEID`][Compiler][
297 The compiler does not support the typeid operator at all.
298 ]]
299 [[`BOOST_NO_TYPENAME_WITH_CTOR`][Compiler][
300 The typename keyword cannot be used when creating a temporary of a
301 Dependent type.
302 ]]
303 [[`BOOST_NO_UNREACHABLE_RETURN_DETECTION`][Compiler][
304 If a return is unreachable, then no return statement should be required,
305 however some compilers insist on it, while other issue a bunch of warnings
306 if it is in fact present.
307 ]]
308 [[`BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE`][Compiler][
309 The compiler will not accept a using declaration that brings a function
310 from a typename used as a base class into a derived class if functions of
311 the same name are present in the derived class.
312 ]]
313 [[`BOOST_NO_USING_TEMPLATE`][Compiler][
314 The compiler will not accept a using declaration that imports a template
315 class or function from another namespace. Originally a Borland specific
316 problem with imports to/from the global namespace, extended to MSVC6
317 which has a specific issue with importing template classes (but not
318 functions).
319 ]]
320 [[`BOOST_NO_VOID_RETURNS`][Compiler][
321 The compiler does not allow a void function to return the result of calling
322 another void function.
323 ``
324 void f() {}
325 void g() { return f(); }
326 ``
327 ]]
328 ]
329
330 [endsect]
331
332 [#config_features]
333
334
335 [section Macros that describe optional features]
336
337 The following macros describe features that are not required by the C++
338 standard. The macro is only defined if the feature is present.
339
340
341 [table
342 [[Macro       ][Section        ][Description       ]]
343
344 [[`BOOST_HAS_BETHREADS`][Platform][
345 The platform supports BeOS style threads.
346 ]]
347 [[`BOOST_HAS_CLOCK_GETTIME`][Platform][
348 The platform has the POSIX API `clock_gettime`.
349 ]]
350 [[`BOOST_HAS_DIRENT_H`][Platform][
351 The platform has the POSIX header `<dirent.h>`.
352 ]]
353 [[`BOOST_HAS_EXPM1`][Platform][
354 The platform has the functions `expm1`, `expm1f` and `expm1l` in `<math.h>`
355 ]]
356 [[`BOOST_HAS_FLOAT128`][Compiler][
357 The compiler has `__float128` as a native type which is distinct
358 from all the regular C++ floating point types.]]
359 [[`BOOST_HAS_FTIME`][Platform][
360 The platform has the Win32 API type FTIME.
361 ]]
362 [[`BOOST_HAS_GETSYSTEMTIMEASFILETIME`][Platform][
363 The platform has the Win32 API GetSystemTimeAsFileTime.
364 ]]
365 [[`BOOST_HAS_GETTIMEOFDAY`][Platform][
366 The platform has the POSIX API `gettimeofday`.
367 ]]
368 [[`BOOST_HAS_HASH`][Standard library][
369 The C++ implementation provides the (SGI) hash_set and hash_map classes.
370 When defined, `BOOST_HASH_SET_HEADER` and `BOOST_HASH_LIST_HEADER` will contain
371 the names of the header needed to access hash_set and hash_map;
372 `BOOST_STD_EXTENSION_NAMESPACE` will provide the namespace in which the two
373 class templates reside.
374 ]]
375 [[`BOOST_HAS_INT128`][Compiler][
376 The compiler has `__int128` and `unsigned __int128` as native types which are distinct
377 from all the regular C++ integer types.]]
378 [[`BOOST_HAS_LOG1P`][Platform][
379 The platform has the functions `log1p`, `log1pf` and `log1pl` in `<math.h>`.
380 ]]
381 [[`BOOST_HAS_MACRO_USE_FACET`][Standard library][
382 The standard library lacks a conforming `std::use_facet`, but has a macro
383 `_USE(loc, Type)` that does the job. This is primarily for the Dinkumware
384 std lib.
385 ]]
386 [[`BOOST_HAS_MS_INT64`][Compiler][
387 The compiler supports the `__int64` data type.
388 ]]
389 [[`BOOST_HAS_NANOSLEEP`][Platform][
390 The platform has the POSIX API nanosleep.
391 ]]
392 [[`BOOST_HAS_NL_TYPES_H`][Platform][
393 The platform has an `<nl_types.h>`.
394 ]]
395 [[`BOOST_HAS_NRVO`][Compiler][
396 Indicated that the compiler supports the named return value optimization
397 (NRVO). Used to select the most efficient implementation for some function.
398 See [@../../../../boost/operators.hpp `<boost/operators.hpp>`] for example.
399 ]]
400 [[`BOOST_HAS_PARTIAL_STD_ALLOCATOR`][Standard Library][
401 The standard library has a partially conforming `std::allocator` class, but
402 without any of the member templates.
403 ]]
404 [[`BOOST_HAS_PRAGMA_ONCE`][Compiler][
405 The compiler recognizes the `#pragma once` directive which tells that the
406 containing header should be included only once while preprocessing the
407 current translation unit. The pragma may improve compile times of large projects
408 with some compilers.
409 ]]
410 [[`BOOST_HAS_PRAGMA_DETECT_MISMATCH`][Compiler][
411 The compiler recognizes the `#pragma detect_mismatch("name", "value")` directive which tells that the
412 link stage should be terminated with error if values for provided `"name"` missmatch.
413 This pragma may be a help in preventing ODR violations and ensuring that different modules
414 are compiled with same flags.
415 ]]
416
417 [[`BOOST_HAS_PTHREAD_DELAY_NP`][Platform][
418 The platform has the POSIX API `pthread_delay_np`.
419 ]]
420 [[`BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE`][Platform][
421 The platform has the POSIX API `pthread_mutexattr_settype`.
422 ]]
423 [[`BOOST_HAS_PTHREAD_YIELD`][Platform][
424 The platform has the POSIX API `pthread_yield`.
425 ]]
426 [[`BOOST_HAS_PTHREADS`][Platform][
427 The platform support POSIX style threads.
428 ]]
429 [[`BOOST_HAS_SCHED_YIELD`][Platform][
430 The platform has the POSIX API `sched_yield`.
431 ]]
432 [[`BOOST_HAS_SGI_TYPE_TRAITS`][Compiler, Standard library][
433 The compiler has native support for SGI style type traits.
434 ]]
435 [[`BOOST_HAS_STDINT_H`][Platform][
436 The platform has a `<stdint.h>`
437 ]]
438 [[`BOOST_HAS_SLIST`][Standard library][
439 The C++ implementation provides the (SGI) slist class. When defined,
440 `BOOST_SLIST_HEADER` will contain the name of the header needed to access
441 `slist` and `BOOST_STD_EXTENSION_NAMESPACE` will provide the namespace in
442 which `slist` resides.
443 ]]
444 [[`BOOST_HAS_STLP_USE_FACET`][Standard library][
445 The standard library lacks a conforming `std::use_facet`, but has a workaround
446 class-version that does the job. This is primarily for the STLport std lib.
447 ]]
448 [[`BOOST_HAS_TR1_ARRAY`][Standard library][
449 The library has a TR1 conforming version of `<array>`.  This macro is only guaranteed
450 to be defined after including one of the headers from Boost.TR1.  Further this macro
451 is now deprecated in favour of BOOST_NO_CXX11_HDR_ARRAY.
452 ]]
453 [[`BOOST_HAS_TR1_COMPLEX_OVERLOADS`][Standard library][
454 The library has a version of `<complex>` that supports passing scalars to the
455 complex number algorithms.
456 ]]
457 [[`BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG`][Standard library][
458 The library has a version of `<complex>` that includes the new inverse trig
459 functions from TR1.
460 ]]
461 [[`BOOST_HAS_TR1_REFERENCE_WRAPPER`][Standard library][
462 The library has TR1 conforming reference wrappers in `<functional>`.  This macro is only guaranteed
463 to be defined after including one of the headers from Boost.TR1.  Further this macro
464 is now deprecated in favour of BOOST_NO_CXX11_HDR_FUNCTIONAL.
465 ]]
466 [[`BOOST_HAS_TR1_RESULT_OF`][Standard library][
467 The library has a TR1 conforming result_of template in `<functional>`.  This macro is only guaranteed
468 to be defined after including one of the headers from Boost.TR1.  Further this macro
469 is now deprecated in favour of BOOST_NO_CXX11_HDR_FUNCTIONAL.
470 ]]
471 [[`BOOST_HAS_TR1_MEM_FN`][Standard library][
472 The library has a TR1 conforming mem_fn function template in `<functional>`.  This macro is only guaranteed
473 to be defined after including one of the headers from Boost.TR1.  Further this macro
474 is now deprecated in favour of BOOST_NO_CXX11_HDR_FUNCTIONAL.
475 ]]
476 [[`BOOST_HAS_TR1_BIND`][Standard library][
477 The library has a TR1 conforming bind function template in `<functional>`.  This macro is only guaranteed
478 to be defined after including one of the headers from Boost.TR1.  Further this macro
479 is now deprecated in favour of BOOST_NO_CXX11_HDR_FUNCTIONAL.
480 ]]
481 [[`BOOST_HAS_TR1_FUNCTION`][Standard library][
482 The library has a TR1 conforming function class template in `<functional>`.  This macro is only guaranteed
483 to be defined after including one of the headers from Boost.TR1.  Further this macro
484 is now deprecated in favour of BOOST_NO_CXX11_HDR_FUNCTIONAL.
485 ]]
486 [[`BOOST_HAS_TR1_HASH`][Standard library][
487 The library has a TR1 conforming hash function template in `<functional>`.  This macro is only guaranteed
488 to be defined after including one of the headers from Boost.TR1.  Further this macro
489 is now deprecated in favour of BOOST_NO_CXX11_HDR_FUNCTIONAL.
490 ]]
491 [[`BOOST_HAS_TR1_SHARED_PTR`][Standard library][
492 The library has a TR1 conforming `shared_ptr` class template in `<memory>`.  This macro is only guaranteed
493 to be defined after including one of the headers from Boost.TR1.  Further this macro
494 is now deprecated in favour of BOOST_NO_CXX11_SMART_PTR.
495 ]]
496 [[`BOOST_HAS_TR1_RANDOM`][Standard library][
497 The library has a TR1 conforming version of `<random>`.  This macro is only guaranteed
498 to be defined after including one of the headers from Boost.TR1.  Further this macro
499 is now deprecated in favour of BOOST_NO_CXX11_HDR_RANDOM.
500 ]]
501 [[`BOOST_HAS_TR1_REGEX`][Standard library][
502 The library has a TR1 conforming version of `<regex>`.  This macro is only guaranteed
503 to be defined after including one of the headers from Boost.TR1.  Further this macro
504 is now deprecated in favour of BOOST_NO_CXX11_HDR_REGEX.
505 ]]
506 [[`BOOST_HAS_TR1_TUPLE`][Standard library][
507 The library has a TR1 conforming version of `<tuple>`.  This macro is only guaranteed
508 to be defined after including one of the headers from Boost.TR1.  Further this macro
509 is now deprecated in favour of BOOST_NO_CXX11_HDR_TUPLE.
510 ]]
511 [[`BOOST_HAS_TR1_TYPE_TRAITS`][Standard library][
512 The library has a TR1 conforming version of `<type_traits>`.  This macro is only guaranteed
513 to be defined after including one of the headers from Boost.TR1.  Further this macro
514 is now deprecated in favour of BOOST_NO_CXX11_HDR_TYPE_TRAITS.
515 ]]
516 [[`BOOST_HAS_TR1_UTILITY`][Standard library][
517 The library has the TR1 additions to `<utility>` (tuple interface to `std::pair`).  This macro is only guaranteed
518 to be defined after including one of the headers from Boost.TR1.  Further this macro
519 is now deprecated in favour of BOOST_NO_CXX11_HDR_TUPLE.
520 ]]
521 [[`BOOST_HAS_TR1_UNORDERED_MAP`][Standard library][
522 The library has a TR1 conforming version of `<unordered_map>`.  This macro is only guaranteed
523 to be defined after including one of the headers from Boost.TR1.  Further this macro
524 is now deprecated in favour of BOOST_NO_CXX11_HDR_UNORDERED_MAP.
525 ]]
526 [[`BOOST_HAS_TR1_UNORDERED_SET`][Standard library][
527 The library has a TR1 conforming version of `<unordered_set>`.  This macro is only guaranteed
528 to be defined after including one of the headers from Boost.TR1.  Further this macro
529 is now deprecated in favour of BOOST_NO_CXX11_HDR_UNORDERED_SET.
530 ]]
531 [[`BOOST_HAS_TR1`][Standard library][
532 Implies all the other `BOOST_HAS_TR1_*` macros should be set.
533 ]]
534 [[`BOOST_HAS_THREADS`][Platform, Compiler][
535 Defined if the compiler, in its current translation mode, supports multiple
536 threads of execution.
537 ]]
538 [[`BOOST_HAS_TWO_ARG_USE_FACET`][Standard library][
539 The standard library lacks a conforming std::use_facet, but has a two
540 argument version that does the job. This is primarily for the Rogue Wave
541 std lib.
542 ]]
543 [[`BOOST_HAS_UNISTD_H`][Platform][
544 The Platform provides `<unistd.h>`.
545 ]]
546 [[`BOOST_HAS_WINTHREADS`][Platform][
547 The platform supports MS Windows style threads.
548 ]]
549 [[`BOOST_MSVC_STD_ITERATOR`][Standard library][
550 Microsoft's broken version of `std::iterator` is being used. This implies that
551 `std::iterator` takes no more than two template parameters.
552 ]]
553 [[`BOOST_MSVC6_MEMBER_TEMPLATES`][Compiler][
554 Microsoft Visual C++ 6.0 has enough member template idiosyncrasies
555 (being polite) that `BOOST_NO_MEMBER_TEMPLATES` is defined for this compiler.
556 `BOOST_MSVC6_MEMBER_TEMPLATES` is defined to allow compiler specific workarounds.
557 This macro gets defined automatically if `BOOST_NO_MEMBER_TEMPLATES` is not
558 defined - in other words this is treated as a strict subset of the features
559 required by the standard.
560 ]]
561 [[`BOOST_HAS_STDINT_H`][Platform][
562 There are no 1998 C++ Standard headers `<stdint.h>` or `<cstdint>`, although the
563 1999 C Standard does include `<stdint.h>`. If `<stdint.h>` is present,
564 `<boost/stdint.h>` can make good use of it, so a flag is supplied (signalling
565 presence; thus the default is not present, conforming to the current C++
566 standard).
567 ]]
568 ]
569
570 [endsect]
571
572 [section Macros that describe possible C++ future features]
573
574 The following macros describe features that may be included in some future
575 ISO C++ standard, but have not yet been approved for inclusion in the language.
576
577
578 [table
579 [[Macro     ][Description     ]]
580
581 [[`BOOST_HAS_CONCEPTS`][
582 The compiler supports  concepts.
583 ]]
584 ]
585
586 [endsect]
587
588 [section Macros that describe C++11 features not supported]
589
590 The following macros describe features in the 2011 ISO C++ standard, formerly known as C++0x,
591 that are not yet supported by a particular compiler or library.
592
593 [table
594 [[Macro     ][Description     ]]
595
596 [[`BOOST_NO_CXX11_ADDRESSOF`][The standard library header <memory> has no working std::addressof.]]
597 [[`BOOST_NO_CXX11_ALIGNAS`][The compiler does not support the `alignas` keyword.]]
598 [[`BOOST_NO_CXX11_ALLOCATOR`][The standard library does not provide a C++11 version of `std::allocator` in <memory>.]]
599 [[`BOOST_NO_CXX11_ATOMIC_SMART_PTR`][The standard library <memory> does not support atomic smart pointer operations.]]
600 [[`BOOST_NO_CXX11_AUTO_DECLARATIONS`][The compiler does not support
601 type deduction for variables declared with the `auto` keyword (`auto var = ...;`).
602 ]]
603 [[`BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS`][The compiler does not support
604 type deduction for multiple variables declared with the `auto` keyword (`auto var = ..., *ptr = ...;`).
605 ]]
606 [[`BOOST_NO_CXX11_CHAR16_T`][The compiler does not support
607 type `char16_t`. 
608 ]]
609 [[`BOOST_NO_CXX11_CHAR32_T`][The compiler does not support 
610 type `char32_t`. 
611 ]]
612 [[`BOOST_NO_CXX11_CONSTEXPR`][The compiler does not support 
613 `constexpr`. 
614 ]]
615 [[`BOOST_NO_CXX11_DECLTYPE`][The compiler does not support 
616 `decltype`. 
617 ]]
618 [[`BOOST_NO_CXX11_DECLTYPE_N3276`][The compiler does not support the extension to
619 `decltype` described in [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3276.pdf N3276],
620 accepted in Madrid, March 2011.
621 ]]
622 [[`BOOST_NO_CXX11_DELETED_FUNCTIONS`][The compiler does not support
623 deleted (`= delete`) functions.
624 ]]
625 [[`BOOST_NO_CXX11_DEFAULTED_FUNCTIONS`][The compiler does not support
626 defaulted (`= default`) functions.
627 ]]
628 [[`BOOST_NO_CXX11_DEFAULTED_MOVES`][The compiler does not support
629 defaulted move constructor or assignment. Other defaulted functions may still be supported.
630 ]]
631 [[`BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS`][The compiler does not support 
632 explicit conversion operators (`explicit operator T()`).
633 ]] 
634 [[`BOOST_NO_CXX11_EXTERN_TEMPLATE`][The compiler does not support 
635 explicit instantiation forward declarations for templates (`extern template ...`).
636 ]]
637 [[`BOOST_NO_CXX11_FINAL`][The compiler does not support the C++ class-virt-specifier final.
638 ]]
639 [[`BOOST_NO_CXX11_FIXED_LENGTH_VARIADIC_TEMPLATE_EXPANSION_PACKS`][The compiler does not support
640 expanding a variadic template parameter pack into a template containing one or more
641 fixed arguments]]
642 [[`BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS`][The compiler does not support
643 default template arguments for function templates.
644 ]]
645 [[`BOOST_NO_CXX11_HDR_ATOMIC`][The standard library does not provide header <atomic>.]]
646 [[`BOOST_NO_CXX11_HDR_ARRAY`][The standard library does not provide header <array>.]]
647 [[`BOOST_NO_CXX11_HDR_CHRONO`][The standard library does not provide header <chrono>.]]
648 [[`BOOST_NO_CXX11_HDR_CODECVT`][The standard library does not provide header <codecvt>.]]
649 [[`BOOST_NO_CXX11_HDR_CONDITION_VARIABLE`][The standard library does not provide header <condition_variable>.]]
650 [[`BOOST_NO_CXX11_HDR_EXCEPTION`][The standard library does not provide a C++11 compatible version of <exception>.]]
651 [[`BOOST_NO_CXX11_HDR_FORWARD_LIST`][The standard library does not provide header <forward_list>.]]
652 [[`BOOST_NO_CXX11_HDR_FUNCTIONAL`][The standard library does not provide a C++11 compatible version of <functional>.]]
653 [[`BOOST_NO_CXX11_HDR_FUTURE`][The standard library does not provide header <future>.]]
654 [[`BOOST_NO_CXX11_HDR_INITIALIZER_LIST`][The standard library does not provide header <initializer_list>.]]
655 [[`BOOST_NO_CXX11_HDR_MUTEX`][The standard library does not provide header <mutex>.]]
656 [[`BOOST_NO_CXX11_HDR_RANDOM`][The standard library does not provide header <random>.]]
657 [[`BOOST_NO_CXX11_HDR_RATIO`][The standard library does not provide header <ratio>.]]
658 [[`BOOST_NO_CXX11_HDR_REGEX`][The standard library does not provide header <regex>.]]
659 [[`BOOST_NO_CXX11_HDR_SYSTEM_ERROR`][The standard library does not provide header <system_error>.]]
660 [[`BOOST_NO_CXX11_HDR_THREAD`][The standard library does not provide header <thread>.]]
661 [[`BOOST_NO_CXX11_HDR_TUPLE`][The standard library does not provide header <tuple>.]]
662 [[`BOOST_NO_CXX11_HDR_TYPEINDEX`][The standard library does not provide header <typeindex>.]]
663 [[`BOOST_NO_CXX11_HDR_TYPE_TRAITS`][The standard library does not provide header <type_traits>.]]
664 [[`BOOST_NO_CXX11_HDR_UNORDERED_MAP`][The standard library does not provide header <unordered_map>.]]
665 [[`BOOST_NO_CXX11_HDR_UNORDERED_SET`][The standard library does not provide header <unordered_set>.]]
666
667 [[`BOOST_NO_CXX11_INLINE_NAMESPACES`][The compiler does not support inline namespaces.]]
668 [[`BOOST_NO_CXX11_LAMBDAS`][The compiler does not support Lambdas. 
669 ]]
670 [[`BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS`][The compiler does not allow to
671 pass local classes as template parameters (this macro intentionally does not
672 control passing of unnamed types as template parameters, see also
673 [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm N2657]).
674 ]]
675 [[`BOOST_NO_CXX11_NON_PUBLIC_DEFAULTED_FUNCTIONS`][The compiler does not support
676 defaulted (`= default`) functions in access control sections other than `public`. Public defaulted
677 functions may still be supported, as indicated by `BOOST_NO_CXX11_DEFAULTED_FUNCTIONS`. Some
678 compilers implementing an early draft of the C++11 standard (in particular, incorporating
679 [@http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#906 DR906]) are susceptible to this problem.
680 ]]
681 [[`BOOST_NO_CXX11_NOEXCEPT`][The compiler does not support `noexcept`. 
682 ]]
683 [[`BOOST_NO_CXX11_NULLPTR`][The compiler does not support `nullptr`. 
684 ]]
685 [[`BOOST_NO_CXX11_NUMERIC_LIMITS`][The standard library `<limits>` header does
686 not support the C++11 version of `numeric_limits`. 
687 ]]
688 [[`BOOST_NO_CXX11_POINTER_TRAITS`][The standard library does not provide a
689 C++11 version of `std::pointer_traits` in <memory>.]]
690 [[`BOOST_NO_CXX11_RANGE_BASED_FOR`][The compiler does not support
691 range-based for statements. 
692 ]]
693 [[`BOOST_NO_CXX11_RAW_LITERALS`][The compiler does not support
694 raw string literals. 
695 ]]
696 [[`BOOST_NO_CXX11_REF_QUALIFIERS`][The compiler does not support
697 ref-qualifiers on member functions as described in 
698 [@http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm N2439]. 
699 ]]
700 [[`BOOST_NO_CXX11_RVALUE_REFERENCES`][The compiler does not support
701 r-value references. 
702 ]]
703 [[`BOOST_NO_CXX11_SCOPED_ENUMS`][The compiler does not support
704 scoped enumerations (`enum class`). 
705 ]]
706 [[`BOOST_NO_CXX11_SFINAE_EXPR`][The compiler does not support
707 usage of C++11 SFINAE with arbitrary expressions.  Use this macro only if you
708 are using all of the features of SFINAE including substitution-failure-on-private-member-access.  
709 Otherwise use BOOST_NO_SFINAE_EXPR or BOOST_NO_SFINAE which get defined for fewer compilers.
710 ]]
711 [[`BOOST_NO_CXX11_SMART_PTR`][The standard library header <memory> has no shared_ptr and unique_ptr.]]
712 [[`BOOST_NO_CXX11_STATIC_ASSERT`][The compiler does not support
713 `static_assert`. 
714 ]]
715 [[`BOOST_NO_CXX11_STD_ALIGN`][The standard library header <memory> has no working std::align.]]
716 [[`BOOST_NO_CXX11_STD_UNORDERED`][The standard library does not support
717 <unordered_map> and <unordered_set>. 
718 ]]
719 [[`BOOST_NO_CXX11_TEMPLATE_ALIASES`][The compiler does not support template aliases. 
720 ]]
721 [[`BOOST_NO_CXX11_THREAD_LOCAL`][The compiler does not support the `thread_local` storage specifier. 
722 ]]
723 [[`BOOST_NO_CXX11_TRAILING_RESULT_TYPES`][The compiler does not support the new function result type
724 specification syntax (e.g. `auto foo(T) -> T;`).]]
725 [[`BOOST_NO_CXX11_UNICODE_LITERALS`][The compiler does not support
726 Unicode (`u8`, `u`, `U`) literals. 
727 ]]
728 [[`BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX`][The compiler does not support
729 the [@http://en.wikipedia.org/wiki/C%2B%2B0x#Uniform_initialization C++11 Unified Initialization Syntax].
730 ]]
731 [[`BOOST_NO_CXX11_USER_DEFINED_LITERALS`][The compiler does not support user defined literals. 
732 ]]
733 [[`BOOST_NO_CXX11_VARIADIC_TEMPLATES`][The compiler does not support
734 variadic templates.
735 ]]
736 [[`BOOST_NO_CXX11_VARIADIC_MACROS`][The compiler does not support
737 variadic macros.
738 ]]
739 [[`BOOST_NO_LONG_LONG`][The compiler does not support `long long`.
740 ]]
741 ]
742
743 [endsect]
744
745 [#config_11_for_03]
746
747 [section Macros that allow use of C++11 features with C++03 compilers]
748
749 The following macros allow use of C++11 features even with compilers that do not yet
750 provide compliant C++11 support.
751
752 [table
753 [[Macro        ][ Description          ]]
754
755 [[`BOOST_ALIGNMENT(X)`, `BOOST_NO_ALIGNMENT`][
756 Some compilers don't support the `alignas` keyword but provide other means to specify alignment
757 (usually, through compiler-specific attributes). The macro `BOOST_ALIGNMENT(X)` will expand to the `alignas(X)`
758 keyword if the compiler supports it or to some compiler-specific attribute to achieve the specified alignment.
759 If no such compiler-specific attribute is known then `BOOST_ALIGNMENT(X)` will expand to nothing and
760 `BOOST_NO_ALIGNMENT` will be defined. Unlike native `alignas`, `X` must always be a compile-time integer constant.
761 The macro can be used to specify alignment of types and data:
762 ``
763   struct BOOST_ALIGNMENT(16) my_data
764   {
765       char c[16];
766   };
767   BOOST_ALIGNMENT(8) int arr[32];
768 ``
769 ]]
770 [[`BOOST_CONSTEXPR`][
771 Some compilers don't support the use of `constexpr`. This macro expands to nothing on those compilers, and `constexpr`
772 elsewhere. For example, when defining a constexpr function or constructor replace:
773 ``
774   constexpr tuple();
775 ``
776 with:
777 ``
778   BOOST_CONSTEXPR tuple();
779 ``
780 ]]
781 [[`BOOST_CONSTEXPR_OR_CONST`][
782 Some compilers don't support the use of `constexpr`. This macro expands to `const` on those compilers, and `constexpr`
783 elsewhere. For example, when defining const expr variables replace:
784 ``
785   static constexpr UIntType xor_mask = a;
786 ``
787 with:
788 ``
789   static BOOST_CONSTEXPR_OR_CONST UIntType xor_mask = a;
790 ``
791 ]]
792 [[`BOOST_STATIC_CONSTEXPR`][
793 This is a shortcut for `static BOOST_CONSTEXPR_OR_CONST`. For example, when defining const expr variables replace:
794 ``
795   static constexpr UIntType xor_mask = a;
796 ``
797 with:
798 ``
799   BOOST_STATIC_CONSTEXPR UIntType xor_mask = a;
800 ``
801 ]]
802 [[`BOOST_DEFAULTED_FUNCTION(fun, body)`][
803 This macro is intended to be used within a class definition in order to declare a default implementation of function `fun`.
804 For the compilers that do not support C++11 defaulted functions the macro will expand into an inline function definition
805 with the `body` implementation. For example:
806 ``
807   struct my_struct
808   {
809       BOOST_DEFAULTED_FUNCTION(my_struct(), {})
810   };
811 ``
812 is equivalent to:
813 ``
814   struct my_struct
815   {
816       my_struct() = default;
817   };
818 ``
819 or:
820 ``
821   struct my_struct
822   {
823       my_struct() {}
824   };
825 ``
826 ]]
827 [[`BOOST_DELETED_FUNCTION(fun)`][
828 This macro is intended to be used within a class definition in order to declare a deleted function `fun`.
829 For the compilers that do not support C++11 deleted functions the macro will expand into a private function
830 declaration with no definition. Since the macro may change the access mode, it is recommended to use this macro
831 at the end of the class definition. For example:
832 ``
833   struct noncopyable
834   {
835       BOOST_DELETED_FUNCTION(noncopyable(noncopyable const&))
836       BOOST_DELETED_FUNCTION(noncopyable& operator= (noncopyable const&))
837   };
838 ``
839 is equivalent to:
840 ``
841   struct noncopyable
842   {
843       noncopyable(noncopyable const&) = delete;
844       noncopyable& operator= (noncopyable const&) = delete;
845   };
846 ``
847 or:
848 ``
849   struct noncopyable
850   {
851   private:
852       noncopyable(noncopyable const&);
853       noncopyable& operator= (noncopyable const&);
854   };
855 ``
856 ]]
857 [[
858 ``
859   BOOST_NOEXCEPT
860   BOOST_NOEXCEPT_OR_NOTHROW
861   BOOST_NOEXCEPT_IF(Predicate)
862   BOOST_NOEXCEPT_EXPR(Expression)
863 ``
864 ][
865 If `BOOST_NO_CXX11_NOEXCEPT` is defined (i.e. C++03 compliant compilers) these macros are defined as:
866 [:
867 ``
868   #define BOOST_NOEXCEPT
869   #define BOOST_NOEXCEPT_OR_NOTHROW throw()
870   #define BOOST_NOEXCEPT_IF(Predicate)
871   #define BOOST_NOEXCEPT_EXPR(Expression) false
872 ``
873 ]
874 If `BOOST_NO_CXX11_NOEXCEPT` is not defined (i.e. C++11 compliant compilers) they are defined as:
875 [:
876 ``
877   #define BOOST_NOEXCEPT noexcept
878   #define BOOST_NOEXCEPT_OR_NOTHROW noexcept
879   #define BOOST_NOEXCEPT_IF(Predicate) noexcept((Predicate))
880   #define BOOST_NOEXCEPT_EXPR(Expression) noexcept((Expression))
881 ``
882 ]
883 ]]
884 [[`BOOST_FINAL`][
885 If `BOOST_NO_CXX11_FINAL` is not defined (i.e. C++11 compliant compilers), expands to `final` keyword,
886 otherwise expands to nothing.
887 ]]
888 [[`BOOST_MSVC_ENABLE_2012_NOV_CTP`][
889 For Microsoft Visual C++ 2012, enable the C++11 features supplied by the
890 November 2012 Community Technology Preview. These features are not automatically
891 enabled because the CTP is non-supported alpha code that is not recommended
892 for production use. This macro must be defined before including any Boost headers,
893 and must be defined for all translation units in the program, including Boost library builds.
894 This macro will no longer have any effect once an official Microsoft
895 release supports the CTP features.
896 ]]
897 ]
898
899 [endsect]
900
901 [section Macros that describe C++14 features not supported]
902
903 The following macros describe features in the 2014 ISO C++ standard, formerly known as C++0y,
904 that are not yet supported by a particular compiler or library.
905
906 [table
907 [[Macro ][Description ]]
908 [[`BOOST_NO_CXX14_AGGREGATE_NSDMI`][The compiler does not support member initializer for aggregates as in the following example:
909 [:
910 ``
911 struct Foo
912 {
913   int x, y = 42;
914 };
915
916 Foo foo = { 0 };
917 ``
918 ]
919 ]]
920 [[`BOOST_NO_CXX14_BINARY_LITERALS`][The compiler does not binary literals (e.g. `0b1010`).]]
921 [[`BOOST_NO_CXX14_CONSTEXPR`][The compiler does not support relaxed `constexpr`.]]
922 [[`BOOST_NO_CXX14_DECLTYPE_AUTO`][The compiler does not support `decltype(auto)`.]]
923 [[`BOOST_NO_CXX14_DIGIT_SEPARATORS`][The compiler does not support digit separators (e.g. `1'000'000`).]]
924 [[`BOOST_NO_CXX14_STD_EXCHANGE`][The compiler does not support `std::exchange()`.]]
925 [[`BOOST_NO_CXX14_GENERIC_LAMBDAS`][The compiler does not support generic lambda (e.g. `[](auto v){ }`).]]
926 [[`BOOST_NO_CXX14_HDR_SHARED_MUTEX`][The standard library does not provide header <shared_mutex>.]]
927 [[`BOOST_NO_CXX14_INITIALIZED_LAMBDA_CAPTURES`][The compiler does not support initialized lambda capture (e.g. `[foo = 42]{ }`).]]
928 [[`BOOST_NO_CXX14_RETURN_TYPE_DEDUCTION`][The compiler does not support return type deduction for normal functions (e.g. `auto f() { return val; }`).]]
929 [[`BOOST_NO_CXX14_VARIABLE_TEMPLATES`][The compiler does not support variable template (e.g. `template <class T> T kibi = T(1024);`).]]
930 ]
931
932 [endsect]
933
934 [#config_14_for_11]
935
936 [section Macros that allow use of C++14 features with C++11 or earlier compilers]
937
938 The following macros allow use of C++14 features even with compilers that do not yet
939 provide compliant C++14 support.
940
941 [table
942 [[Macro ][ Description ]]
943 [[`BOOST_CXX14_CONSTEXPR`][This macro works similar to `BOOST_CONSTEXPR`, but expands to `constexpr` only if the C++14 "relaxed" `constexpr` is available.]]
944 ]
945
946 [endsect]
947
948 [section Macros that describe C++17 features not supported]
949
950 The following macros describe features in the 2017 ISO C++ standard, formerly known as C++1z,
951 that are not yet supported by a particular compiler or library.
952
953 [table
954 [[Macro ][Description ]]
955 [[`BOOST_NO_CXX17_HDR_OPTIONAL`][The compiler does not support the header `<optional>`.]]
956 [[`BOOST_NO_CXX17_HDR_VARIANT`][The compiler does not support the header `<variant>`.]]
957 [[`BOOST_NO_CXX17_HDR_STRING_VIEW`][The compiler does not support the header `<string_view>`.]]
958 [[`BOOST_NO_CXX17_STD_APPLY`][The compiler does not support `std::apply()`.]]
959 [[`BOOST_NO_CXX17_STD_INVOKE`][The compiler does not support `std::invoke()`.]]
960 [[`BOOST_NO_CXX17_ITERATOR_TRAITS`][The compiler does not support SFINAE-friendly `std::iterator_traits`.]]
961 [[`BOOST_NO_CXX17_IF_CONSTEXPR`][The compiler does not support `if constexpr`.]]
962 [[`BOOST_NO_CXX17_INLINE_VARIABLES`][The compiler does not support `inline` variables.]]
963 ]
964
965 [endsect]
966
967 [#config_17_for_14]
968
969 [section Macros that allow use of C++17 features with C++14 or earlier compilers]
970
971 The following macros allow use of C++17 features even with compilers that do not yet
972 provide compliant C++17 support.
973
974 [table
975 [[Macro ][ Description ]]
976 [[`BOOST_INLINE_VARIABLE`][This macro expands to `inline` on compilers that support C++17 inline variables and to nothing otherwise. Users may need to check for `BOOST_NO_CXX17_INLINE_VARIABLES` for further adjustments to the code.]]
977 ]
978
979 [endsect]
980
981 [section Macros that describe features that have been removed from the standard.]
982
983 The following macros describe features which were required by one version of the standard, but have been removed by later versions.
984
985 [table
986 [[Macro ][Description ]]
987 [[`BOOST_NO_CXX98_RANDOM_SHUFFLE`][The standard library no longer supports `std::random_shuffle()`. It was deprecated in C++11 and is removed from C++14.]]
988 [[`BOOST_NO_AUTO_PTR`][The standard library no longer supports `std::auto_ptr`. It was deprecated in C++11 and is removed from C++14.]]
989 [[`BOOST_NO_CXX98_FUNCTION_BASE`][The standard library no longer supports `std::unary_function` and `std::binary_function`. They were deprecated in C++11 and is removed from C++14.]]
990 [[`BOOST_NO_CXX98_BINDERS`][The standard library no longer supports `std::bind1st`, `std::bind2nd`, `std::ptr_fun` and `std::mem_fun`. They were deprecated in C++11 and is removed from C++14.]]
991 ]
992
993 [endsect]
994
995 [#config_helpers]
996
997 [section Boost Helper Macros]
998
999 The following macros are either simple helpers, or macros that provide
1000 workarounds for compiler/standard library defects.
1001
1002
1003 [table
1004 [[Macro           ][Description            ]]
1005
1006 [[`BOOST_WORKAROUND`][
1007 This macro is used where a compiler specific workaround is required that is not otherwise
1008 described by one of the other Boost.Config macros.  To use the macro you must first
1009 ``
1010 #include <boost/config/workaround.hpp>
1011 ``
1012 usage is then:
1013 ``
1014 #if BOOST_WORKAROUND(MACRONAME, CONDITION)
1015    // workaround code goes here...
1016 #else
1017    // Standard conforming code goes here...
1018 #endif
1019 ``
1020 where `MACRONAME` is a macro that usually describes the version number to be tested against, and `CONDITION`
1021 is a comparison operator followed by a value.  For example `BOOST_WORKAROUND(BOOST_INTEL, <= 1010)` would 
1022 evaluate to `1` for Intel C++ 10.1 and earlier.  
1023
1024 The macro can also be used with `BOOST_TESTED_AT` if all
1025 current compiler versions exhibit the issue, but the issue is expected to be fixed at some later point.  
1026
1027 For example
1028 `BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590))` would normally evaluate to `1` for all values
1029 of `__BORLANDC__` /unless/ the macro `BOOST_DETECT_OUTDATED_WORKAROUNDS` is defined, in which case evaluates to
1030 `(__BORLANDC__ <= 0x590)`.
1031
1032 [*Note]: the ultimate source of documentation for this macro is in [@../../../../boost/config/workaround.hpp boost/config/workaround.hpp].
1033 ]]
1034 [[`BOOST_PREVENT_MACRO_SUBSTITUTION`][
1035 Sometimes you have a function name with the same name as a C macro, for example "min" and "max"
1036 member functions, in which case one can prevent the function being expanded as a macro using:
1037 ``
1038 someclass.min BOOST_PREVENT_MACRO_SUBSTITUTION(arg1, arg2);
1039 ``
1040 The following also works in most, but not all, contexts:
1041 ``
1042 (someclass.max)(arg1, arg2);
1043 ``
1044 ]]
1045 [[`BOOST_DEDUCED_TYPENAME`][
1046 Some compilers don't support the use of typename for dependent types in deduced
1047 contexts. This macro expands to nothing on those compilers, and typename
1048 elsewhere. For example, replace:
1049 `template <class T> void f(T, typename T::type);`
1050 with:
1051 `template <class T> void f(T, BOOST_DEDUCED_TYPENAME T::type);`
1052 ]]
1053 [[`BOOST_HASH_MAP_HEADER`][
1054 The header to include to get the SGI `hash_map` class. This macro is only
1055 available if `BOOST_HAS_HASH` is defined.
1056 ]]
1057 [[`BOOST_HASH_SET_HEADER`][
1058 The header to include to get the SGI `hash_set` class. This macro is only
1059 available if `BOOST_HAS_HASH` is defined.
1060 ]]
1061 [[`BOOST_SLIST_HEADER`][
1062 The header to include to get the SGI `slist` class. This macro is only
1063 available if `BOOST_HAS_SLIST` is defined.
1064 ]]
1065 [[`BOOST_STD_EXTENSION_NAMESPACE`][
1066 The namespace used for std library extensions (hashtable classes etc).
1067 ]]
1068 [[`BOOST_STATIC_CONSTANT(Type, assignment)`][
1069 On compilers which don't allow in-class initialization of static integral
1070 constant members, we must use enums as a workaround if we want the constants
1071 to be available at compile-time. This macro gives us a convenient way to
1072 declare such constants.
1073 For example instead of:
1074 ``
1075 struct foo{
1076    static const int value = 2;
1077 };
1078 ``
1079 use:
1080 ``
1081 struct foo{
1082    BOOST_STATIC_CONSTANT(int, value = 2);
1083 };
1084 ``
1085 ]]
1086 [[`BOOST_UNREACHABLE_RETURN(result)`][
1087 Normally evaluates to nothing, but evaluates to return x; if the compiler
1088 requires a return, even when it can never be reached.
1089 ]]
1090 [[`BOOST_FALLTHROUGH`][ 
1091 The BOOST_FALLTHROUGH macro can be used to annotate implicit fall-through 
1092 between switch labels: 
1093 `` 
1094  switch (x) { 
1095  case 40: 
1096  case 41: 
1097     if (truth_is_out_there) { 
1098        ++x; 
1099        BOOST_FALLTHROUGH;  // Use instead of/along with annotations in 
1100        // comments. 
1101     } else { 
1102       return x; 
1103     } 
1104     case 42: 
1105        ... 
1106 `` 
1107 As shown in the example above, the BOOST_FALLTHROUGH macro should be 
1108 followed by a semicolon. It is designed to mimic control-flow statements 
1109 like 'break;', so it can be placed in most places where 'break;' can, but 
1110 only if there are no statements on the execution path between it and the 
1111 next switch label. 
1112
1113 When compiled with Clang >3.2 in C++11 mode, the BOOST_FALLTHROUGH macro is 
1114 expanded to `[[clang::fallthrough]]` attribute, which is analysed when 
1115 performing switch labels fall-through diagnostic ('-Wimplicit-fallthrough'). 
1116 See clang [@http://clang.llvm.org/docs/LanguageExtensions.html#clang__fallthrough 
1117 documentation on language extensions for details.] 
1118
1119 When used with unsupported compilers, the BOOST_FALLTHROUGH macro has no 
1120 effect on diagnostics. 
1121
1122 In either case this macro has no effect on runtime behavior and performance 
1123 of code. 
1124 ]] 
1125 [[`BOOST_EXPLICIT_TEMPLATE_TYPE(t)`
1126
1127   `BOOST_EXPLICIT_TEMPLATE_NON_TYPE(t,v)`
1128
1129   `BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(t)`
1130
1131   `BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t,v)`][
1132 Some compilers silently "fold" different function template instantiations if
1133 some of the template parameters don't appear in the function parameter list.
1134 For instance:
1135 ``
1136   #include <iostream>
1137   #include <ostream>
1138   #include <typeinfo>
1139
1140   template <int n>
1141   void f() { std::cout << n << ' '; }
1142
1143   template <typename T>
1144   void g() { std::cout << typeid(T).name() << ' '; }
1145
1146   int main() {
1147     f<1>();
1148     f<2>();
1149
1150     g<int>();
1151     g<double>();
1152   }
1153 ``
1154 incorrectly outputs [^2 2 double double] on VC++ 6. These macros, to be used
1155 in the function parameter list, fix the problem without effects on the calling
1156 syntax. For instance, in the case above write:
1157 ``
1158   template <int n>
1159   void f(BOOST_EXPLICIT_TEMPLATE_NON_TYPE(int, n)) { ... }
1160
1161   template <typename T>
1162   void g(BOOST_EXPLICIT_TEMPLATE_TYPE(T)) { ... }
1163 ``
1164 Beware that they can declare (for affected compilers) a dummy defaulted
1165 parameter, so they
1166
1167 [*a)] should be always invoked [*at the end] of the parameter list
1168
1169 [*b)] can't be used if your function template is multiply declared.
1170
1171 Furthermore, in order to add any needed comma separator, an `APPEND_*` version
1172 must be used when the macro invocation appears after a normal parameter
1173 declaration or after the invocation of another macro of this same group.
1174 ]]
1175 [[`BOOST_USE_FACET(Type, loc)`][
1176 When the standard library does not have a conforming `std::use_facet` there
1177 are various workarounds available, but they differ from library to library.
1178 This macro provides a consistent way to access a locale's facets. For example,
1179 replace:
1180 `std::use_facet<Type>(loc);`
1181 with:
1182 `BOOST_USE_FACET(Type, loc);`
1183 Note do not add a `std::` prefix to the front of `BOOST_USE_FACET`.
1184 ]]
1185 [[`BOOST_HAS_FACET(Type, loc)`][
1186 When the standard library does not have a comforming `std::has_facet` there
1187 are various workarounds available, but they differ from library to library.
1188 This macro provides a consistent way to check a locale's facets. For example,
1189 replace:
1190 `std::has_facet<Type>(loc);`
1191 with:
1192 `BOOST_HAS_FACET(Type, loc);`
1193 Note do not add a `std::` prefix to the front of `BOOST_HAS_FACET`.
1194 ]]
1195 [[`BOOST_NESTED_TEMPLATE`][
1196 Member templates are supported by some compilers even though they can't use
1197 the `A::template member<U>` syntax, as a workaround replace:
1198 `typedef typename A::template rebind<U> binder;`
1199 with:
1200 `typedef typename A::BOOST_NESTED_TEMPLATE rebind<U> binder;`
1201 ]]
1202 [[`BOOST_STRINGIZE(X)`][
1203 Converts the parameter `X` to a string after macro replacement on `X` has
1204 been performed.
1205 ]]
1206 [[`BOOST_JOIN(X,Y)`][
1207 This piece of macro magic joins the two arguments together, even when one of
1208 the arguments is itself a macro (see 16.3.1 in C++ standard). This is normally
1209 used to create a mangled name in combination with a predefined macro such a
1210 \_\_LINE__.
1211 ]]
1212 [[`BOOST_RESTRICT`][
1213 This macro can be used in place of the compiler specific variant of the C99 `restrict` keyword to
1214 notify the compiler that, for the lifetime of the qualified pointer variable, only it and its
1215 derivative value will be used to gain access to the object it references. This limits the effect of
1216 pointer aliasing and helps the optimizers in generating better code. However, i this condition is
1217 violated, undefined behavior may occurs.
1218
1219 Usage example:
1220 ``
1221   void perform_computation( float* BOOST_RESTRICT in, float* BOOST_RESTRICT out )
1222   {
1223     *out = *in * 0.5f;
1224   }
1225 ``
1226 ]]
1227 [[`BOOST_FORCEINLINE`][
1228 This macro can be used in place of the `inline` keyword to instruct the compiler
1229 that the function should always be inlined.
1230 Overuse of this macro can lead to significant bloat, while good use can increase
1231 performance in certain cases, such as computation-intensive code built through
1232 generative programming techniques.
1233
1234 Usage example:
1235 ``
1236   template<class T>
1237   BOOST_FORCEINLINE T& f(T& t)
1238   {
1239       return t;
1240   }
1241 ``
1242
1243 Note that use of this macro can lead to cryptic error messages with some compilers.
1244 Consider defining it to `inline` before including the Boost.Config header in order to be
1245 able to debug errors more easily.
1246 ]]
1247 [[`BOOST_NOINLINE`][
1248 This macro can be used in place of the `inline` keyword to instruct the compiler
1249 that the function should never be inlined. One should typically use this macro
1250 to mark functions that are unlikely to be called, such as error handling routines.
1251
1252 Usage example:
1253 ``
1254   BOOST_NOINLINE void handle_error(const char* descr)
1255   {
1256       // ...
1257   }
1258 ``
1259 ]]
1260 [[`BOOST_NORETURN`][
1261 This macro can be used before the function declaration or definition to instruct the compiler
1262 that the function does not return normally (i.e. with a `return` statement or by leaving
1263 the function scope, if the function return type is `void`). The macro can be used to mark
1264 functions that always throw exceptions or terminate the application. Compilers that support
1265 this markup may use this information to specifically organize the code surrounding calls to
1266 this function and suppress warnings about missing `return` statements in the functions
1267 enclosing such calls.
1268
1269 Usage example:
1270 ``
1271   BOOST_NORETURN void on_error_occurred(const char* descr)
1272   {
1273       throw std::runtime_error(descr);
1274   }
1275 ``
1276
1277 If the compiler does not support this markup, `BOOST_NORETURN` is defined empty and an
1278 additional macro `BOOST_NO_NORETURN` is defined.
1279 ]]
1280 [[`BOOST_LIKELY(X)`
1281
1282   `BOOST_UNLIKELY(X)`][
1283 These macros communicate to the compiler that the conditional expression `X` is likely
1284 or unlikely to yield a positive result. The expression should result in a boolean value.
1285 The result of the macro is an integer or boolean value equivalent to the result of `X`.
1286
1287 The macros are intended to be used in branching statements. The additional hint they provide
1288 can be used by the compiler to arrange the compiled code of the branches more effectively.
1289
1290 Usage example:
1291 ``
1292   if (BOOST_UNLIKELY(ptr == NULL))
1293     handle_error("ptr is NULL");
1294 ``
1295 ]]
1296 [[`BOOST_ATTRIBUTE_UNUSED`][Expands to `__attribute__((unused))` when this is available - 
1297 can be used to disable compiler warnings relating to unused types or variables.]]
1298 [[`BOOST_ATTRIBUTE_NODISCARD`][Expands to `[[nodiscard]]` when this is available - 
1299 can be used to create a warning when a type or variable is unused.]]
1300 [[`BOOST_ATTRIBUTE_NO_UNIQUE_ADDRESS`][Expands to `[[no_unique_address]]` when this is available - 
1301 can be used to indicate that a non-static data member need not have a unique address (for example empty classes).]]
1302 [[`BOOST_MAY_ALIAS`, `BOOST_NO_MAY_ALIAS`][
1303 `BOOST_MAY_ALIAS` expands to a type attribute that can be used to mark types that may
1304 alias other types. Pointers or references to such marked types can be used to access objects
1305 of other types. If the compiler supports this feature `BOOST_NO_MAY_ALIAS` is not defined.
1306 Otherwise `BOOST_MAY_ALIAS` expands to nothing and `BOOST_NO_MAY_ALIAS` is defined.
1307
1308 Usage example:
1309 ``
1310   struct BOOST_MAY_ALIAS aliasing_struct;
1311   typedef unsigned int BOOST_MAY_ALIAS aliasing_uint;
1312 ``
1313 ]]
1314 [[`BOOST_PRAGMA_MESSAGE(M)`][Defined in header `<boost/config/pragma_message.hpp>`,
1315 this macro expands to the equivalent of `#pragma message(M)`. `M` must be a string
1316 literal.
1317
1318 Example: `BOOST_PRAGMA_MESSAGE("This header is deprecated.")`
1319
1320 The messages issued by `BOOST_PRAGMA_MESSAGE` can be suppressed by defining the macro
1321 `BOOST_DISABLE_PRAGMA_MESSAGE`.]]
1322
1323 [[`BOOST_HEADER_DEPRECATED(A)`][Defined in header `<boost/config/header_deprecated.hpp>`,
1324 this macro issues the message "This header is deprecated. Use `A` instead." via
1325 `BOOST_PRAGMA_MESSAGE`. `A` must be a string literal.
1326
1327 Example: `BOOST_HEADER_DEPRECATED("<boost/config/workaround.hpp>")`
1328
1329 The messages issued by `BOOST_HEADER_DEPRECATED` can be suppressed by defining the macro
1330 `BOOST_ALLOW_DEPRECATED_HEADERS`.]]
1331 ]
1332
1333 [endsect]
1334
1335 [#config_info_macros]
1336
1337 [section Boost Informational Macros]
1338
1339 The following macros describe boost features; these are, generally speaking
1340 the only boost macros that should be tested in user code.
1341
1342 [table
1343
1344 [[Macro            ][Header         ][Description               ]]
1345
1346 [[`BOOST_VERSION`][`<boost/version.hpp>`][
1347 Describes the boost version number in XYYYZZ format such that:
1348 `(BOOST_VERSION % 100)` is the sub-minor version, `((BOOST_VERSION / 100) % 1000)`
1349 is the minor version, and `(BOOST_VERSION / 100000)` is the major version.
1350 ]]
1351 [[`BOOST_NO_INT64_T`][`<boost/cstdint.hpp>` `<boost/stdint.h>`][
1352 Defined if there are no 64-bit integral types: `int64_t`, `uint64_t` etc.
1353 ]]
1354 [[`BOOST_NO_INTEGRAL_INT64_T`][`<boost/cstdint.hpp>` `<boost/stdint.h>`][
1355 Defined if `int64_t` as defined by `<boost/cstdint.hpp>` is not usable in
1356 integral constant expressions.
1357 ]]
1358 [[`BOOST_MSVC`][`<boost/config.hpp>`][
1359 Defined if the compiler is really Microsoft Visual C++, as opposed to one
1360 of the many other compilers that also define `_MSC_VER`.  Has the same value as 
1361 _MSC_VER.
1362 ]]
1363 [[`BOOST_MSVC_FULL_VER`][`<boost/config.hpp>`][
1364 Defined to a normalised 9 digit version of _MSC_FULL_VER (which sometimes only has 8 digits), 
1365 the macro has the form VVMMPPPPP where VV is the major version number, MM is the minor version number, and
1366 PPPPP is the compiler build number.
1367 ]]
1368 [[`BOOST_GCC`][`<boost/config.hpp>`][
1369 Defined if the compiler is really GCC, as opposed to one
1370 of the many other compilers that also define `__GNUC__`.  Has the value:
1371 `__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__`.
1372 ]]
1373 [[`BOOST_INTEL`][`<boost/config.hpp>`][
1374 Defined if the compiler is an Intel compiler, takes the same value as the
1375 compiler version macro.
1376 ]]
1377 [[`BOOST_CLANG`][`<boost/config.hpp>`][
1378 Defined to 1 if the compiler is the Clang compiler.
1379 ]]
1380 [[`BOOST_WINDOWS`][`<boost/config.hpp>`][
1381 Defined if the Windows platform API is available.
1382 ]]
1383 [[`BOOST_DINKUMWARE_STDLIB`][`<boost/config.hpp>`][
1384 Defined if the dinkumware standard library is in use, takes the same value
1385 as the Dinkumware library version macro `_CPPLIB_VER` if defined, otherwise 1.
1386 ]]
1387 [[`BOOST_NO_WREGEX`][`<boost/regex.hpp>`][
1388 Defined if the regex library does not support wide character regular
1389 expressions.
1390 ]]
1391 [[`BOOST_COMPILER`][`<boost/config.hpp>`][
1392 Defined as a string describing the name and version number of the compiler
1393 in use. Mainly for debugging the configuration.
1394 ]]
1395 [[`BOOST_STDLIB`][`<boost/config.hpp>`][
1396 Defined as a string describing the name and version number of the standard
1397 library in use. Mainly for debugging the configuration.
1398 ]]
1399 [[`BOOST_PLATFORM`][`<boost/config.hpp>`][
1400 Defined as a string describing the name of the platform. Mainly for debugging
1401 the configuration.
1402 ]]
1403 ]
1404
1405 [endsect]
1406
1407 [#deprecated_macros]
1408
1409 [section Boost Deprecated Macros]
1410
1411 The following have been deprecated; please use the replacements instead.
1412 They will be removed in a future version of boost.
1413
1414 [table
1415
1416 [[Deprecated Macro][Replacement][When deprecated][When removed]]
1417
1418 [[`BOOST_NO_0X_HDR_ARRAY`][`BOOST_NO_CXX11_HDR_ARRAY`][Boost 1.50][]]
1419 [[`BOOST_NO_0X_HDR_CHRONO`][`BOOST_NO_CXX11_HDR_CHRONO`][Boost 1.50][]]
1420 [[`BOOST_NO_0X_HDR_CODECVT`][`BOOST_NO_CXX11_HDR_CODECVT`][Boost 1.50][]]
1421 [[`BOOST_NO_0X_HDR_CONDITION_VARIABLE`][`BOOST_NO_CXX11_HDR_CONDITION_VARIABLE`][Boost 1.50][]]
1422 [[`BOOST_NO_0X_HDR_FORWARD_LIST`][`BOOST_NO_CXX11_HDR_FORWARD_LIST`][Boost 1.50][]]
1423 [[`BOOST_NO_0X_HDR_FUTURE`][`BOOST_NO_CXX11_HDR_FUTURE`][Boost 1.50][]]
1424 [[`BOOST_NO_0X_HDR_INITIALIZER_LIST`][`BOOST_NO_CXX11_HDR_INITIALIZER_LIST`][Boost 1.50][]]
1425 [[`BOOST_NO_INITIALIZER_LISTS`][`BOOST_NO_CXX11_HDR_INITIALIZER_LIST`][Boost 1.50][]]
1426 [[`BOOST_NO_0X_HDR_MUTEX`][`BOOST_NO_CXX11_HDR_MUTEX`][Boost 1.50][]]
1427 [[`BOOST_NO_0X_HDR_RANDOM`][`BOOST_NO_CXX11_HDR_RANDOM`][Boost 1.50][]]
1428 [[`BOOST_NO_0X_HDR_RATIO`][`BOOST_NO_CXX11_HDR_RATIO`][Boost 1.50][]]
1429 [[`BOOST_NO_0X_HDR_REGEX`][`BOOST_NO_CXX11_HDR_REGEX`][Boost 1.50][]]
1430 [[`BOOST_NO_0X_HDR_SYSTEM_ERROR`][`BOOST_NO_CXX11_HDR_SYSTEM_ERROR`][Boost 1.50][]]
1431 [[`BOOST_NO_0X_HDR_THREAD`][`BOOST_NO_CXX11_HDR_THREAD`][Boost 1.50][]]
1432 [[`BOOST_NO_0X_HDR_TUPLE`][`BOOST_NO_CXX11_HDR_TUPLE`][Boost 1.50][]]
1433 [[`BOOST_NO_0X_HDR_TYPE_TRAITS`][`BOOST_NO_CXX11_HDR_TYPE_TRAITS`][Boost 1.50][]]
1434 [[`BOOST_NO_0X_HDR_TYPEINDEX`][`BOOST_NO_CXX11_HDR_TYPEINDEX`][Boost 1.50][]]
1435 [[`BOOST_NO_0X_HDR_UNORDERED_SET`][`BOOST_NO_CXX11_HDR_UNORDERED_SET`][Boost 1.50][]]
1436 [[`BOOST_NO_0X_HDR_UNORDERED_MAP`][`BOOST_NO_CXX11_HDR_UNORDERED_MAP`][Boost 1.50][]]
1437 [[`BOOST_NO_STD_UNORDERED`][`BOOST_NO_CXX11_HDR_UNORDERED_SET`][Boost 1.50][]]
1438 [[][][][]]
1439 [[`BOOST_NO_AUTO_DECLARATIONS`][`BOOST_NO_CXX11_AUTO_DECLARATIONS`][Boost 1.51][]]
1440 [[`BOOST_NO_AUTO_MULTIDECLARATIONS`][`BOOST_NO_CXX11_AUTO_MULTIDECLARATIONS`][Boost 1.51][]]
1441 [[`BOOST_NO_CHAR16_T`][`BOOST_NO_CXX11_CHAR16_T`][Boost 1.51][]]
1442 [[`BOOST_NO_CHAR32_T`][`BOOST_NO_CXX11_CHAR32_T`][Boost 1.51][]]
1443 [[`BOOST_NO_TEMPLATE_ALIASES`][`BOOST_NO_CXX11_TEMPLATE_ALIASES`][Boost 1.51][]]
1444 [[`BOOST_NO_CONSTEXPR`][`BOOST_NO_CXX11_CONSTEXPR`][Boost 1.51][]]
1445 [[`BOOST_NO_DECLTYPE`][`BOOST_NO_CXX11_DECLTYPE`][Boost 1.51][]]
1446 [[`BOOST_NO_DECLTYPE_N3276`][`BOOST_NO_CXX11_DECLTYPE_N3276`][Boost 1.51][]]
1447 [[`BOOST_NO_DEFAULTED_FUNCTIONS`][`BOOST_NO_CXX11_DEFAULTED_FUNCTIONS`][Boost 1.51][]]
1448 [[`BOOST_NO_DELETED_FUNCTIONS`][`BOOST_NO_CXX11_DELETED_FUNCTIONS`][Boost 1.51][]]
1449 [[`BOOST_NO_EXPLICIT_CONVERSION_OPERATORS`][`BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS`][Boost 1.51][]]
1450 [[`BOOST_NO_EXTERN_TEMPLATE`][`BOOST_NO_CXX11_EXTERN_TEMPLATE`][Boost 1.51][]]
1451 [[`BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS`][`BOOST_NO_CXX11_FUNCTION_TEMPLATE_DEFAULT_ARGS`][Boost 1.51][]]
1452 [[`BOOST_NO_LAMBDAS`][`BOOST_NO_CXX11_LAMBDAS`][Boost 1.51][]]
1453 [[`BOOST_NO_LOCAL_CLASS_TEMPLATE_PARAMETERS`][`BOOST_NO_CXX11_LOCAL_CLASS_TEMPLATE_PARAMETERS`][Boost 1.51][]]
1454 [[`BOOST_NO_NOEXCEPT`][`BOOST_NO_CXX11_NOEXCEPT`][Boost 1.51][]]
1455 [[`BOOST_NO_NULLPTR`][`BOOST_NO_CXX11_NULLPTR`][Boost 1.51][]]
1456 [[`BOOST_NO_RAW_LITERALS`][`BOOST_NO_CXX11_RAW_LITERALS`][Boost 1.51][]]
1457 [[`BOOST_NO_RVALUE_REFERENCES`][`BOOST_NO_CXX11_RVALUE_REFERENCES`][Boost 1.51][]]
1458 [[`BOOST_NO_SCOPED_ENUMS`][`BOOST_NO_CXX11_SCOPED_ENUMS`][Boost 1.51][]]
1459 [[`BOOST_NO_STATIC_ASSERT`][`BOOST_NO_CXX11_STATIC_ASSERT`][Boost 1.51][]]
1460 [[`BOOST_NO_STD_UNORDERED`][`BOOST_NO_CXX11_STD_UNORDERED`][Boost 1.51][]]
1461 [[`BOOST_NO_UNICODE_LITERALS`][`BOOST_NO_CXX11_UNICODE_LITERALS`][Boost 1.51][]]
1462 [[`BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX`][`BOOST_NO_CXX11_UNIFIED_INITIALIZATION_SYNTAX`][Boost 1.51][]]
1463 [[`BOOST_NO_VARIADIC_TEMPLATES`][`BOOST_NO_CXX11_VARIADIC_TEMPLATES`][Boost 1.51][]]
1464 [[`BOOST_NO_VARIADIC_MACROS`][`BOOST_NO_CXX11_VARIADIC_MACROS`][Boost 1.51][]]
1465 [[`BOOST_NO_NUMERIC_LIMITS_LOWEST`][`BOOST_NO_CXX11_NUMERIC_LIMITS`][Boost 1.51][]]
1466 [[][][][]]
1467 [[`BOOST_HAS_STATIC_ASSERT`][`BOOST_NO_CXX11_STATIC_ASSERT` (negated)][Boost 1.53][]]
1468 [[`BOOST_HAS_VARIADIC_TMPL`][`BOOST_NO_CXX11_VARIADIC_TEMPLATES` (negated)][Boost 1.53][]]
1469 [[`BOOST_HAS_RVALUE_REFS`][`BOOST_NO_CXX11_RVALUE_REFERENCES` (negated)][Boost 1.53][]]
1470 [[`BOOST_HAS_CHAR16_T`][`BOOST_NO_CXX11_CHAR16_T` (negated)][Boost 1.53][]]
1471 [[`BOOST_HAS_CHAR32_T`][`BOOST_NO_CXX11_CHAR32_T` (negated)][Boost 1.53][]]
1472 ]
1473
1474 [endsect]
1475
1476 [section Macros for libraries with separate source code]
1477
1478 The following macros and helper headers are of use to authors whose libraries
1479 include separate source code, and are intended to address several issues:
1480
1481 * Controlling shared library symbol visibility
1482 * Fixing the ABI of the compiled library
1483 * Selecting which compiled library to link against based upon the compilers settings
1484
1485 See [@http://www.boost.org/development/separate_compilation.html Guidelines for Authors of Boost Libraries Containing Separate Source]
1486
1487 [section Macros controlling shared library symbol visibility]
1488
1489 Some compilers support C++ extensions that control which symbols 
1490 will be exported from shared libraries such as dynamic shared objects (DSO's) on Unix-like
1491 systems or dynamic-link libraries (DLL's) on Windows.
1492
1493 The Microsoft VC++ compiler has long supplied 
1494 `__declspec(dllexport)` and `__declspec(dllimport)` extensions for this purpose,
1495 as do virtually all other compilers targeting the Windows platform.
1496  
1497 Modern versions of the GNU GCC compiler provide the `__attribute__((visibility("default")))` 
1498 extension to indicate that a symbol should be exported. All other symbols may be hidden by using the
1499 `-fvisibility-hidden` or `-fvisibility-ms-compat` compiler switches.
1500
1501 Boost supplies several macros to make it easier to manage symbol visibility in a way that
1502 is portable between compilers and operating systems.
1503
1504 [table
1505 [[Macro       ][Description       ]]
1506 [[`BOOST_SYMBOL_EXPORT`][
1507 Defines the syntax of a C++ language extension that indicates a symbol is to be exported from a shared library.
1508 If the compiler has no such extension, the macro is defined with no replacement text. 
1509 ]]
1510 [[`BOOST_SYMBOL_IMPORT`][
1511 Defines the syntax of a C++ language extension that indicates a symbol is to be imported from a shared library.
1512 If the compiler has no such extension, the macro is defined with no replacement text. 
1513 ]]
1514 [[`BOOST_SYMBOL_VISIBLE`][
1515 Defines the syntax of a C++ language extension that indicates a symbol is to be globally visible.
1516 If the compiler has no such extension, the macro is defined with no replacement text. 
1517 Needed for classes that are not otherwise exported, but are used by RTTI. Examples include
1518 class for objects that will be thrown as exceptions or used in dynamic_casts,
1519 across shared library boundaries. For example, a header-only exception class might look like this:
1520 ``
1521   class BOOST_SYMBOL_VISIBLE my_exception : public std::runtime_error { ... };
1522 `` 
1523 Without BOOST_SYMBOL_VISIBLE, it would be impossible to catch my_exception thrown from a shared library
1524 compiled by GCC with the -fvisibility=hidden option.
1525 ]]
1526 [[`BOOST_HAS_DECLSPEC`][
1527 The compiler has C++ extensions `__declspec(dllexport)` and `__declspec(dllimport)` to control
1528 export/import of symbols from shared libraries.
1529 ['Deprecated. This macro is no longer necessary since BOOST_SYMBOL_EXPORT and BOOST_SYMBOL_IMPORT
1530 are now supplied. It is provided to support legacy code.]
1531 ]]
1532 ]
1533
1534 Typical usage:
1535
1536 [*boost/foo/config.hpp]
1537
1538     ...
1539     #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_FOO_DYN_LINK)
1540     # if defined(BOOST_FOO_SOURCE)
1541     #   define BOOST_FOO_DECL BOOST_SYMBOL_EXPORT
1542     # else 
1543     #   define BOOST_FOO_DECL BOOST_SYMBOL_IMPORT
1544     # endif
1545     #else
1546     # define BOOST_FOO_DECL
1547     #endif
1548     ...
1549  
1550 [*boost/foo/foo.hpp] 
1551   
1552     #include <boost/foo/config.hpp>
1553     ...
1554     class BOOST_FOO_DECL bar { ... };
1555     ...
1556     void BOOST_FOO_DECL f();
1557     ...
1558
1559 [*boost/libs/foo/src/foo.cpp] 
1560    
1561     #define BOOST_FOO_SOURCE
1562     #include <boost/foo/foo.hpp>    
1563     ...
1564     void BOOST_FOO_DECL f()
1565     {
1566       ...
1567     }
1568     ...
1569      
1570 [endsect]
1571
1572 [section ABI Fixing]
1573
1574 When linking against a pre-compiled library it vital that the ABI used by the
1575 compiler when building the library ['matches exactly] the ABI used by the code
1576 using the library.  In this case ABI means things like the struct packing
1577 arrangement used, the name mangling scheme used, or the size of some types
1578 (enum types for example).  This is separate from things like threading support,
1579 or runtime library variations, which have to be dealt with by build variants.
1580 To put this in perspective there is one compiler (Borland's) that has so many
1581 compiler options that make subtle changes to the ABI, that at least in theory
1582 there 3200 combinations, and that's without considering runtime library
1583 variations. Fortunately these variations can be managed by `#pragma`'s that
1584 tell the compiler what ABI to use for the types declared in your library.
1585 In order to avoid sprinkling `#pragma`'s all over the boost headers, there are
1586 some prefix and suffix headers that do the job. Typical usage is:
1587
1588 [*my_library.hpp]
1589
1590     #ifndef MY_INCLUDE_GUARD
1591     #define MY_INCLUDE_GUARD
1592
1593     // all includes go here:
1594     ``[^[*#include <boost/config.hpp>]]``
1595     #include <whatever>
1596
1597     ``[^[*#include <boost/config/abi_prefix.hpp>]]`` // must be the last #include
1598
1599     namespace boost {
1600
1601     // your code goes here
1602
1603     }
1604
1605     ``[^[*#include <boost/config/abi_suffix.hpp>]]`` // pops abi_prefix.hpp pragmas
1606
1607     #endif // include guard
1608
1609 [*my_library.cpp]
1610
1611     ...
1612     // nothing special need be done in the implementation file
1613     ...
1614
1615 The user can disable this mechanism by defining `BOOST_DISABLE_ABI_HEADERS`, or
1616 they can define `BOOST_ABI_PREFIX` and/or `BOOST_ABI_SUFFIX` to point to their
1617 own prefix/suffix headers if they so wish.
1618
1619 [endsect]
1620
1621 [section Automatic library selection]
1622
1623 It is essential that users link to a build of a library which was built against
1624 the same runtime library that their application will be built against -if this
1625 does not happen then the library will not be binary compatible with their own
1626 code- and there is a high likelihood  that their application will experience
1627 runtime crashes.  These kinds of problems can be extremely time consuming and
1628 difficult to debug, and often lead to frustrated users and authors alike (simply
1629 selecting the right library to link against is not as easy as it seems when
1630 their are 6-8 of them to chose from, and some users seem to be blissfully
1631 unaware that there even are different runtimes available to them).
1632
1633 To solve this issue, some compilers allow source code to contain `#pragma`'s that
1634 instruct the linker which library to link against, all the user need do is
1635 include the headers they need, place the compiled libraries in their library
1636 search path, and the compiler and linker do the rest. Boost.config supports
1637 this via the header `<boost/config/auto_link.hpp>`, before including this header
1638 one or more of the following macros need to be defined:
1639
1640 [variablelist
1641 [[`BOOST_LIB_NAME`][
1642 Required: An identifier containing the basename of the library, for
1643 example 'boost_regex'.
1644 ]]
1645 [[`BOOST_DYN_LINK`][
1646 Optional: when set link to dll rather than static library.
1647 ]]
1648 [[`BOOST_LIB_DIAGNOSTIC`][
1649 Optional: when set the header will print out the name of the library selected
1650 (useful for debugging).
1651 ]]
1652 [[`BOOST_AUTO_LINK_NOMANGLE`][
1653 Optional: whan set specifies that we should link to BOOST_LIB_NAME.lib, rather than a mangled-name version.]]
1654 [[`BOOST_AUTO_LINK_TAGGED`][Optional: Specifies that we link to libraries built with the --layout=tagged option.
1655                           This is essentially the same as the default name-mangled version, but without
1656                           the compiler name and version, or the Boost version.  Just the build options.]]
1657 [[`BOOST_AUTO_LINK_SYSTEM`][Optional: Specifies that we link to libraries built with the --layout=system option.
1658                           This is essentially the same as the non-name-mangled version, but with
1659                           the prefix to differentiate static and dll builds]]
1660 ]
1661
1662 If the compiler supports this mechanism, then it will be told to link against
1663 the appropriately named library, the actual algorithm used to mangle the name
1664 of the library is documented inside `<boost/config/auto_link.hpp>` and has to
1665 match that used to create the libraries via bjam 's install rules.
1666
1667
1668 [*my_library.hpp]
1669
1670     ...
1671     //
1672     // Don't include auto-linking code if the user has disabled it by
1673     // defining BOOST_ALL_NO_LIB, or BOOST_MY_LIBRARY_NO_LIB, or if this 
1674     // is one of our own source files (signified by BOOST_MY_LIBRARY_SOURCE):
1675     //
1676     #if !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_MY_LIBRARY_NO_LIB) && !defined(BOOST_MY_LIBRARY_SOURCE)
1677     #  define BOOST_LIB_NAME boost_my_library
1678     #  ifdef BOOST_MY_LIBRARY_DYN_LINK
1679     #     define BOOST_DYN_LINK
1680     #  endif
1681     #  include <boost/config/auto_link.hpp>
1682     #endif
1683     ...
1684
1685 [*my_library.cpp]
1686
1687     // define BOOST_MY_LIBRARY_SOURCE so that the header knows that the
1688     // library is being built (possibly exporting rather than importing code)
1689     //
1690     #define BOOST_MY_LIBRARY_SOURCE
1691
1692     #include <boost/my_library/my_library.hpp>
1693     ...
1694
1695 [endsect]
1696
1697 [endsect]
1698
1699 [endsect]
1700
1701
1702