BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bsls_libraryfeatures.h
Go to the documentation of this file.
1/// @file bsls_libraryfeatures.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// bsls_libraryfeatures.h -*-C++-*-
8#ifndef INCLUDED_BSLS_LIBRARYFEATURES
9#define INCLUDED_BSLS_LIBRARYFEATURES
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup bsls_libraryfeatures bsls_libraryfeatures
15/// @brief Provide macros to identify native standard library features.
16/// @addtogroup bsl
17/// @{
18/// @addtogroup bsls
19/// @{
20/// @addtogroup bsls_libraryfeatures
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#bsls_libraryfeatures-purpose"> Purpose</a>
25/// * <a href="#bsls_libraryfeatures-classes"> Classes </a>
26/// * <a href="#bsls_libraryfeatures-macros"> Macros </a>
27/// * <a href="#bsls_libraryfeatures-description"> Description </a>
28/// * <a href="#bsls_libraryfeatures-guarding-against-mixing-c-versions"> Guarding Against Mixing C++ Versions </a>
29/// * <a href="#bsls_libraryfeatures-converse-logic-is-not-symmetric"> Converse Logic Is Not Symmetric </a>
30/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_c90_gets"> BSLS_LIBRARYFEATURES_HAS_C90_GETS </a>
31/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_fp_classify"> BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY </a>
32/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_library"> BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY </a>
33/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_snprintf"> BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF </a>
34/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp98_auto_ptr"> BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR </a>
35/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp98_binders_api"> BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API </a>
36/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_baseline_library"> BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY </a>
37/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_baseline_library"> BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY </a>
38/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_integer_sequence"> BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE </a>
39/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_baseline_library"> BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY </a>
40/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_baseline_library"> BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY </a>
41/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_exception_handling"> BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING </a>
42/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_garbage_collection_api"> BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API </a>
43/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_miscellaneous_utilities"> BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES </a>
44/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_pair_piecewise_constructor"> BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR </a>
45/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_precise_bitwidth_atomics"> BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS </a>
46/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_search_functors"> BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS </a>
47/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_search_overload"> BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD </a>
48/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_deprecated_removed"> BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED </a>
49/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_deprecated_removed"> BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED </a>
50/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_program_termination"> BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION </a>
51/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_range_functions"> BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS </a>
52/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_range_functions"> BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS </a>
53/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_stream_move"> BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE </a>
54/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_tuple"> BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE </a>
55/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_unique_ptr"> BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR </a>
56/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_bool_constant-not-defined"> BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT: !NOT DEFINED! </a>
57/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_range_functions"> BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS </a>
58/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_aligned_alloc"> BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC </a>
59/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_timespec_get"> BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET </a>
60/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_special_math_functions"> BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS </a>
61/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_int_charconv"> BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV </a>
62/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_charconv"> BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV </a>
63/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_filesystem"> BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM </a>
64/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_pmr"> BSLS_LIBRARYFEATURES_HAS_CPP17_PMR </a>
65/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_pmr_string"> BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING </a>
66/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_version"> BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION </a>
67/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_concepts"> BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS </a>
68/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_ranges"> BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES </a>
69/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_source_location"> BSLS_LIBRARYFEATURES_HAS_CPP20_SOURCE_LOCATION </a>
70/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_ref"> BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_REF </a>
71/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_lock_free_type_aliases"> BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_LOCK_FREE_TYPE_ALIASES </a>
72/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_wait_free_functions"> BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_WAIT_FREE_FUNCTIONS </a>
73/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_flag_test_free_functions"> BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_FLAG_TEST_FREE_FUNCTIONS </a>
74/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_make_unique_for_overwrite"> BSLS_LIBRARYFEATURES_HAS_CPP20_MAKE_UNIQUE_FOR_OVERWRITE </a>
75/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_calendar"> BSLS_LIBRARYFEATURES_HAS_CPP20_CALENDAR </a>
76/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_char8_mb_conv"> BSLS_LIBRARYFEATURES_HAS_CPP20_CHAR8_MB_CONV </a>
77/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_is_layout_compatible"> BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE </a>
78/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_is_corresponding_member"> BSLS_LIBRARYFEATURES_HAS_CPP20_IS_CORRESPONDING_MEMBER </a>
79/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_is_pointer_interconvertible"> BSLS_LIBRARYFEATURES_HAS_CPP20_IS_POINTER_INTERCONVERTIBLE </a>
80/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_jthread"> BSLS_LIBRARYFEATURES_HAS_CPP20_JTHREAD </a>
81/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_gnu"> BSLS_LIBRARYFEATURES_STDCPP_GNU </a>
82/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_ibm"> BSLS_LIBRARYFEATURES_STDCPP_IBM </a>
83/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_intellisense"> BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE </a>
84/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_llvm"> BSLS_LIBRARYFEATURES_STDCPP_LLVM </a>
85/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_msvc"> BSLS_LIBRARYFEATURES_STDCPP_MSVC </a>
86/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_libcstd"> BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD </a>
87/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_stlport"> BSLS_LIBRARYFEATURES_STDCPP_STLPORT </a>
88/// * <a href="#bsls_libraryfeatures-usage"> Usage </a>
89/// * <a href="#bsls_libraryfeatures-example-1-managing-library-dependent-interfaces"> Example 1: Managing Library-Dependent Interfaces </a>
90///
91/// # Purpose {#bsls_libraryfeatures-purpose}
92/// Provide macros to identify native standard library features.
93///
94/// # Classes {#bsls_libraryfeatures-classes}
95///
96///
97/// # Macros {#bsls_libraryfeatures-macros}
98///
99/// - BSLS_LIBRARYFEATURES_HAS_C90_GETS: C90 `gets` provided
100/// - BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY: fpclassify et al. provided in std
101/// - BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY: C99 library provided
102/// - BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF: C99 `snprintf` provided
103/// - BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR: `auto_ptr` provided
104/// - BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API: adaptable function API provided
105/// - BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY: C++11 base lib provided
106/// - BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING: except handling provided
107/// - BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API: GC support provided
108/// - BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES: misc utils provided
109/// - BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR: use "piecewise"
110/// - BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION: "program exit" provided
111/// - BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS: `begin` and `end` provided
112/// - BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE: basic_stream move operations
113/// - BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE: `tuple` provided
114/// - BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR: `unique_ptr` provided
115/// - BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY: C++14 base lib provided
116/// - BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE: @ref integer_sequence defined
117/// - BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS: range functions extension
118/// - BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY: C++17 base lib provided
119/// - BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT: !NOT DEFINED! see below
120/// - BSLS_LIBRARYFEATURES_HAS_CPP17_EXCEPTION_HANDLING: except handling provided
121/// - BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS: optional atomics
122/// - BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS: searcher function objects
123/// - BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD: searcher object overload
124/// - BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED: `ptr_fun` et al. gone
125/// - BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV: `<charconv>` for integers only
126/// - BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV: full `<charconv`> support w floats
127/// - BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM: `<filesystem>`
128/// - BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS: `<execution>`
129/// - BSLS_LIBRARYFEATURES_HAS_CPP17_PMR: `<memory_resource>`
130/// - BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING: `pmr::string`
131/// - BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET: `<ctime>`
132/// - BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC: `<cstdlib>`
133/// - BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION: `<version>`
134/// - BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY: C++20 base lib provided
135/// - BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED: `result_of` et al. gone
136/// - BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS: `<concepts>`
137/// - BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES: `<ranges>`
138/// - BSLS_LIBRARYFEATURES_HAS_CPP20_SOURCE_LOCATION: `<source_location>`
139/// - BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_REF: `atomic_ref`
140/// - BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_LOCK_FREE_TYPE_ALIASES:
141/// - `atomic_[un]signed_lock_free`
142/// - BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_WAIT_FREE_FUNCTIONS:
143/// - `bsl::atomic_flag_wait[_explicit]`
144/// - BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_FLAG_TEST_FREE_FUNCTIONS:
145/// - `bsl::atomic_flag_test[_explicit]`
146/// - BSLS_LIBRARYFEATURES_HAS_CPP20_MAKE_UNIQUE_FOR_OVERWRITE: `*_for_overwrite`
147/// - BSLS_LIBRARYFEATURES_HAS_CPP20_CALENDAR: `<chrono>` Calendar/TZ additions
148/// - BSLS_LIBRARYFEATURES_HAS_CPP20_CHAR8_MB_CONV: `mbrtoc8` & `c8rtomb`
149/// - BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE: type trait
150/// - BSLS_LIBRARYFEATURES_HAS_CPP20_IS_CORRESPONDING_MEMBER: type trait
151/// - BSLS_LIBRARYFEATURES_HAS_CPP20_IS_POINTER_INTERCONVERTIBLE: type traits
152/// - BSLS_LIBRARYFEATURES_HAS_CPP20_JTHREAD: `std::jthread`
153/// - BSLS_LIBRARYFEATURES_STDCPP_GNU: implementation is GNU libstdc++
154/// - BSLS_LIBRARYFEATURES_STDCPP_IBM: implementation is IBM
155/// - BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE: Intellisense is running
156/// - BSLS_LIBRARYFEATURES_STDCPP_LLVM: implementation is LLVM libc++
157/// - BSLS_LIBRARYFEATURES_STDCPP_MSVC: implementation is MSVC
158/// - BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD: implementation is Sun's (RogueWave)
159/// - BSLS_LIBRARYFEATURES_STDCPP_STLPORT: implementation is STLPort
160///
161/// @see bsls_platform, bsls_compilerfeatures
162///
163/// # Description {#bsls_libraryfeatures-description}
164/// This component provides a suite of preprocessor macros that
165/// indicate the availability of library-specific support of features that may
166/// not be available in all standard library versions in use across an
167/// organization. None of these macros will be defined unless the compiler is
168/// building with a tool-chain targeting at least experimental support for a
169/// more recent standard than C++03. For example, the C++11 standard library
170/// introduced several functions and types that were not available in libraries
171/// for earlier standards. The macro
172/// `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` can be used to
173/// conditionally compile BDE code depending on those functions when they are
174/// available, and exclude that code when those functions are not present,
175/// thereby allowing compilation by earlier tool-chains.
176///
177/// The standard library version described by these macros always corresponds to
178/// that used to build this component and is the source of the symbols found in
179/// the `std` namespace.
180///
181/// ## Guarding Against Mixing C++ Versions {#bsls_libraryfeatures-guarding-against-mixing-c-versions}
182///
183///
184/// This component defines a "link-coercion" symbol that prevents linking a
185/// translation unit (that includes this header, possibly indirectly) built
186/// against one version of the C++ Standard with a translation unit (also
187/// including this header) built against another version of the Standard. For
188/// example, attempting to link objects built with C++14 with those built with
189/// C++17 will result in a link-time failure. Because BDE supports a variety of
190/// features that are enabled depending on the C++ version for which code is
191/// built, it is generally not safe to link code built with one version of C++
192/// with code built with another version. For example, in C++11 there are move
193/// constructor signatures, whereas in C++03 there are not, and linking code
194/// that views the set of constructors for a type differently is an ODR
195/// violation. The link-coercion symbol that enforces this is meant to provide
196/// users a single, easy-to-comprehend link-time error, rather than having bugs
197/// potentially manifest at runtime in ways that are difficult to diagnose.
198///
199/// ## Converse Logic Is Not Symmetric {#bsls_libraryfeatures-converse-logic-is-not-symmetric}
200///
201///
202/// The macros defined by this component describe features empirically observed
203/// in typical platform/compiler/library combinations used in BDE distributions.
204/// The definition of any of these macros implies that a resource is available,
205/// however, the converse is *not* guaranteed. If a macro is not defined, the
206/// associated resource may or may not exist in the library. For example, the
207/// resource may exist but may be of too early an implementation to be of use to
208/// clients of BDE, so in that case the associated macro would *not* be defined.
209///
210/// ## BSLS_LIBRARYFEATURES_HAS_C90_GETS {#bsls_libraryfeatures-bsls_libraryfeatures_has_c90_gets}
211///
212///
213/// The `BSLS_LIBRARYFEATURES_HAS_C90_GETS` macro is defined if the `gets`
214/// function (defined in `<cstdio>`) is provided in namespace `std` by the
215/// native standard library. This dangerous function is removed from the C++14
216/// standard library, and its use with earlier dialects is strongly discouraged.
217///
218/// ## BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY {#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_fp_classify}
219///
220///
221/// The `BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY` macro is defined if *all* of
222/// the listed floating-point classification functions, defined in the headers
223/// named below, are implemented by the native standard library in namespace
224/// `std`:
225///
226/// - Functions defined in `<cmath>`
227/// - `fpclassify`
228/// - `isfinite`
229/// - `isinf`
230/// - `isnan`
231/// - `isnormal`
232/// - `signbit`
233/// - `isgreater`
234/// - `isgreaterequal`
235/// - `isless`
236/// - `islessequal`
237/// - `islessgreater`
238/// - `isunordered`
239///
240/// ## BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_library}
241///
242///
243/// The `BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY` macro is defined if *all* of the
244/// listed functions and types, defined in the headers named below, are
245/// implemented by the native standard library in namespace `std`:
246///
247/// * Functions defined in `<cctype>`
248/// - `isblank`
249/// * Types defined in `<cmath>`
250/// - `double_t`
251/// - `float_t`
252/// * Functions defined in `<cmath>`
253/// - `acosh`
254/// - `asinh`
255/// - `atanh`
256/// - `cbrt`
257/// - `copysign`
258/// - `erf`
259/// - `erfc`
260/// - `exp2`
261/// - `expm1`
262/// - `fdim`
263/// - `fma`
264/// - `fmax`
265/// - `fmin`
266/// - `hypot`
267/// - `ilogb`
268/// - `lgamma`
269/// - `llrint`
270/// - `log1p`
271/// - `log2`
272/// - `logb`
273/// - `lrint`
274/// - `lround`
275/// - `llround`
276/// - `nan`
277/// - `nanl`
278/// - `nanf`
279/// - `nearbyint`
280/// - `nextafter`
281/// - `nexttoward`
282/// - `remainder`
283/// - `remquo`
284/// - `rint`
285/// - `round`
286/// - `scalbln`
287/// - `scalbn`
288/// - `tgamma`
289/// - `trunc`
290/// * Functions defined in `<cstdlib>`
291/// - `atoll`
292/// - `llabs`
293/// - `lldiv`
294/// - `lldiv_t`
295/// - `strtof`
296/// - `strtold`
297/// - `strtoll`
298/// - `strtoull`
299/// * Functions defined in `<cstdio>`
300/// - `vfscanf`
301/// - `vsscanf`
302/// - `vsnprintf`
303/// - `vsscanf`
304/// * Functions defined in `<cwchar>`
305/// - `vfwscanf`
306/// - `vswscanf`
307/// - `vwscanf`
308/// - `wcstof`
309/// - `wcstold`
310/// - `wcstoll`
311/// - `wcstoull`
312/// * Functions defined in `<cwctype>`
313/// - `iswblank`
314///
315/// This macro is defined first for the following compiler versions:
316///
317/// * GCC 4.8
318/// * clang 3.0 using at least GCC 4.8 GNU C++ library
319/// * Microsoft Visual Studio 2015 / MSVC 19.00
320///
321/// Notice that the above list does *not* include `snprintf` as that is included
322/// in the separate `BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF` macro. Also note
323/// that AIX and Solaris compilers generally have implementations of these
324/// functions in the global namespace when including the corresponding C header,
325/// but do not provide the standard C++ mapping.
326///
327/// ## BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF {#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_snprintf}
328///
329///
330/// The `BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF` macro is defined if `snprintf`
331/// function (defined in `<cstdio>`) is implemented by the native standard
332/// library in namespace `std`.
333///
334/// * Function defined in `<cstdio>`
335/// - `snprintf`
336///
337/// This macro is defined first for the following compiler versions:
338///
339/// * GCC 4.8
340/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
341/// * Microsoft Visual Studio 2015 / MSVC 19.00
342///
343/// ## BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp98_auto_ptr}
344///
345///
346/// The `BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR` macro is defined if the
347/// `auto_ptr` class template (defined in `<memory>`) is provided by the native
348/// standard library. This macro is expected to be defined for all
349/// libraries/platforms at least until the introduction of C++17 to our build
350/// systems.
351///
352/// ## BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp98_binders_api}
353///
354///
355/// The `BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API` macro is defined if the
356/// `result_type`, `argument_type`, `first_argument_type` and
357/// `second_argument_type` typedefs (defined in `<functional>`) are provided by
358/// the native standard library. This macro is expected to be defined for all
359/// libraries/platforms at least until the introduction of C++20 to our build
360/// systems.
361///
362/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_baseline_library}
363///
364///
365/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is used to
366/// identify whether the current platform's standard library supports a baseline
367/// set of C++11 library features (which are defined below). This is especially
368/// important in BSL when importing standard library functions and types into
369/// the `bsl::` namespace, as is done in `bsl+bslhdrs`. In particular this
370/// macro is used where C++11 has introduced new functions and types into
371/// headers available in older versions of the C++ standard. For example, C++11
372/// introduced the type @ref move_iterator to the existing `<iterator>` header, so
373/// `bsl_iterator.h` uses this macro to determine whether to import
374/// `std::move_iterator` into the `bsl` namespace.
375///
376/// This macro is defined if *both* of the listed conditions are true:
377///
378/// * The compiler supports C++11 language features.
379/// * The following functions and types are provided by the native standard
380/// library:
381/// - Functions defined in `<algorithm>`
382/// - `all_of`
383/// - `any_of`
384/// - `copy_if`
385/// - `copy_n`
386/// - `find_if_not`
387/// - `is_heap`
388/// - `is_heap_until`
389/// - `is_partitioned`
390/// - `is_permutation`
391/// - `is_sorted`
392/// - `is_sorted_until`
393/// - `minmax`
394/// - @ref minmax_element
395/// - `move`
396/// - @ref move_backward
397/// - `none_of`
398/// - @ref partition_copy
399/// - @ref partition_point
400/// - `shuffle`
401/// - Types defined in `<atomic>`
402/// - atomic class template and specializations for integral types
403/// - Functions defined in `<complex>`
404/// - `acosh`
405/// - `asinh`
406/// - `atanh`
407/// - `proj`
408/// - Functions and types defined in `<exception>`
409/// - @ref current_exception
410/// - `exception_ptr`
411/// - @ref rethrow_exception
412/// - Functions and types defined in `<functional>`
413/// - `bind`
414/// - `bit_and`
415/// - `bit_or`
416/// - `bit_xor`
417/// - `cref`
418/// - `is_bind_expression`
419/// - `is_placeholder`
420/// - `mem_fn`
421/// - `ref`
422/// - @ref reference_wrapper
423/// - Functions defined in `<iomanip>`
424/// - @ref get_money
425/// - @ref put_money
426/// - Functions and types defined in `<ios>`
427/// - `io_errc`
428/// - @ref iostream_category
429/// - `is_error_code_enum`
430/// - `make_error_code`
431/// - `make_error_condition`
432/// - `hexfloat`
433/// - `defaultfloat`
434/// - Functions defined in `<iterator>`
435/// - `begin`
436/// - `end`
437/// - @ref move_iterator
438/// - `make_move_iterator`
439/// - `next`
440/// - `prev`
441/// - Function defined in `<locale>`
442/// - `isblank`
443/// - Functions defined in `<memory>`
444/// - `addressof`
445/// - @ref pointer_traits
446/// - `uninitialized_copy_n`
447/// - Function defined in `<numeric>`
448/// - `iota`
449/// - Member function defined in `<typeinfo>`
450/// - `type_info::hash_code`
451/// - Functions defined in `<utility>`
452/// - `declval`
453/// - `forward`
454/// - `move`
455/// - `move_if_noexcept`
456/// - `swap`
457/// * The following headers can be included:
458/// - `<array>`
459/// - `<atomic>`
460/// - `<chrono>`
461/// - `<codecvt>`
462/// - `<condition_variable>`
463/// - `<forward_list>`
464/// - `<future>`
465/// - `<mutex>`
466/// - `<random>`
467/// - `<regex>`
468/// - `<scoped_allocator>`
469/// - `<system_error>`
470/// - `<thread>`
471/// - `<typeindex>`
472/// - `<unordered_map>`
473/// - `<unordered_set>`
474///
475/// This macro is defined first for the following compiler versions:
476///
477/// * GCC 4.8
478/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
479/// * Microsoft Visual Studio 2015 / MSVC 19.00
480///
481/// Notice that the above list does *not* include @ref random_shuffle as that is
482/// deprecated in C++14 and will be removed in C++17.
483///
484/// ## BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_baseline_library}
485///
486///
487/// The `BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY` macro is used to
488/// identify whether the current platform's standard library supports a baseline
489/// set of C++14 library features (which are defined below). This is especially
490/// important in BSL when importing standard library functions and types into
491/// the `bsl::` namespace, as is done in `bsl+bslhdrs`.
492///
493/// This macro is defined if *all* of the listed conditions are true:
494///
495/// * The compiler supports C++14 language features.
496/// * The following functions and types are provided by the native standard
497/// library:
498/// - UDLs support for `<chrono>`
499/// - UDLs support for `<complex>`
500/// - Type defined in `<functional>`
501/// - bit_not
502/// - Function defined in `<iterator>`
503/// - make_reverse_iterator
504/// - Function defined in `<iomanip>`
505/// - quoted
506/// - Function defined in `<memory>`
507/// - @ref make_unique
508/// - Function defined in `<type_traits>`
509/// - `is_null_pointer`
510/// - `is_final`
511/// - Function defined in `<utility>`
512/// - `exchange`
513/// * The header `<shared_mutex>` is available providing the standard
514/// components.
515///
516/// This macro is defined first for the following compiler versions:
517///
518/// * GCC 4.9
519/// * clang 3.4
520/// * Microsoft Visual Studio 2015 / MSVC 19.00
521///
522/// ## BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_integer_sequence}
523///
524///
525/// The `BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE` macro is defined if
526/// *all* of the listed conditions are true:
527///
528/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
529/// * The `BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES` macro is also
530/// defined.
531///
532/// * The `BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES` macro is also
533/// defined.
534///
535/// Note that though `struct` @ref integer_sequence was introduced in the C++14
536/// standard, `bsl::integer_sequence` is supported by BDE when compiling in
537/// C++11 mode.
538///
539/// This macro is defined first for the following compiler versions:
540///
541/// * GCC 4.8
542/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
543/// * Microsoft Visual Studio 2015 / MSVC 19.00
544///
545/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_baseline_library}
546///
547///
548/// This macro is used to identify whether the current platform's standard
549/// library supports a baseline set of C++17 library features (which are defined
550/// below). This is especially important in BSL when importing standard library
551/// functions and types into the `bsl::` namespace, as is done in `bsl+bslhdrs`.
552///
553/// This macro is defined if all of the listed conditions are true:
554///
555/// * The compiler supports C++17 language features.
556/// * The following headers can be included:
557/// - `<any>`
558/// - `<optional>`
559/// - `<variant>`
560/// - `<string_view>`
561///
562/// This macro is defined first for the following compiler versions:
563///
564/// * GCC 7
565/// * clang 7
566/// * Microsoft Visual Studio 2019 / MSVC 19.20
567///
568/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_baseline_library}
569///
570///
571/// This macro is used to identify whether the current platform's standard
572/// library supports a baseline set of C++20 library features (which are defined
573/// below). This is especially important in BSL when importing standard library
574/// functions and types into the `bsl::` namespace, as is done in `bsl+bslhdrs`.
575///
576/// This macro is defined if all of the listed conditions are true:
577///
578/// * The compiler supports C++20 language features.
579/// * The following headers can be included:
580/// - `<barrier>`
581/// - `<bit>`
582/// - `<latch>`
583/// - `<numbers>`
584/// - `<semaphore>`
585/// - `<span>`
586/// - `<stop_token>`
587/// * The `<type_traits>` header defines:
588/// - `std::remove_cvref`
589/// - `std::type_identify`
590///
591/// This macro is defined first for the following compiler versions:
592///
593/// - GCC 11.1
594/// - clang 15 when compiling against either:
595/// - libc++ version 15, or
596/// - libstdc++ version 11
597/// - Microsoft Visual Studio 2022 / MSVC 19.30
598///
599/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_exception_handling}
600///
601///
602/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING` macro is defined if
603/// *both* of the listed conditions are true:
604///
605/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
606/// * The following functions and types are provided by the native standard
607/// library in `<exception>`:
608/// - `exception_ptr`
609/// - `make_exception_ptr`
610/// - @ref nested_exception
611/// - `rethrow_if_nested`
612/// - `throw_with_nested`
613///
614/// This macro is defined first for the following compiler versions:
615///
616/// * GCC 4.8
617/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
618/// * Microsoft Visual Studio 2015 / MSVC 19.00
619///
620/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_garbage_collection_api}
621///
622///
623/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API` macro is defined
624/// if *both* of the listed conditions are true:
625///
626/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
627/// * The following functions and types are provided by the native standard
628/// library in `<memory>`:
629/// - `declare_no_pointers`
630/// - @ref declare_reachable
631/// - `get_pointer_safety`
632/// - @ref pointer_safety
633/// - `undeclare_no_pointers`
634/// - @ref undeclare_reachable
635///
636/// This macro is defined first for the following compiler versions:
637///
638/// * GCC 6.0
639/// * clang 3.0 using at least GCC 6.0 GNU C++ Library
640/// * Microsoft Visual Studio 2015 / MSVC 19.00
641///
642/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_miscellaneous_utilities}
643///
644///
645/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES` macro is
646/// defined if *both* of the listed conditions are true:
647///
648/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
649/// * The following functions and types are provided by the native standard
650/// library:
651/// - Type defined in `<cstddef>`
652/// - `max_align_t`
653/// - Functions defined in `<exception>`
654/// - @ref get_terminate
655/// - @ref get_unexpected
656/// - Functions defined in `<iomanip>`
657/// - @ref get_time
658/// - @ref put_time
659/// - Functions defined in `<locale>`
660/// - `isblank`
661/// - @ref wstring_convert
662/// - @ref wbuffer_convert
663/// - Function defined in `<memory>`
664/// - `align`
665/// - Class and function defined in `<new>`
666/// - `bad_array_new_length`
667/// - `get_new_handler`
668///
669/// This macro is defined first for the following compiler versions:
670///
671/// * GCC 5.0
672/// * clang 3.0 using at least GCC 5.0 GNU C++ Library
673/// * Microsoft Visual Studio 2015 / MSVC 19.00
674///
675/// Notice that the function @ref get_unexpected will be removed in C++17.
676///
677/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_pair_piecewise_constructor}
678///
679///
680/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR` macro is
681/// defined if the `pair` class template (defined in `<utility>`) provided by
682/// the native library has a constructor with the signature:
683/// @code
684/// template <class... Args1, class... Args2>
685/// pair(piecewise_construct_t ,
686/// tuple<Args1...> first_args,
687/// tuple<Args2...> second_args);
688/// @endcode
689/// Notice that the existence of the above constructor implies that each of the
690/// following conditions are also true:
691///
692/// * The `piecewise_construct_t` (tag) type (defined in `<utility>`) is
693/// provided by the native standard library.
694/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
695/// * The `BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES` macro is defined.
696/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE` macro is defined.
697///
698/// This macro is defined first for the following compiler versions:
699///
700/// * GCC 4.8
701/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
702/// * Microsoft Visual Studio 2015 / MSVC 19.00
703///
704/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_precise_bitwidth_atomics}
705///
706///
707/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS` macro is
708/// defined if *both* of the listed conditions are true: defined if the
709/// `<atomic>` header provided by the native standard library provides type
710/// aliases for all of the following precise bit-width atomic types:
711///
712/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
713/// * The following type aliases are provided by the native standard library in
714/// the `<atomic>` header:
715/// - `atomic_int8_t`
716/// - `atomic_int16_t`
717/// - `atomic_int32_t`
718/// - `atomic_int64_t`
719/// - `atomic_uint8_t`
720/// - `atomic_uint16_t`
721/// - `atomic_uint32_t`
722/// - `atomic_uint64_t`
723/// - `atomic_intptr_t`
724/// - `atomic_uintptr_t`
725///
726/// This macro is defined first for the following compiler versions:
727///
728/// * GCC 7.0
729/// * clang 3.0 using at least GCC 7.0 GNU C++ Library
730/// * Microsoft Visual Studio 2015 / MSVC 19.00
731///
732/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_search_functors}
733///
734///
735/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS` macro is defined if the
736/// native library supplies the following class templates in `<functional>`:
737///
738/// * @ref default_searcher
739/// * `boyer_moore_searcher`
740/// * `boyer_moore_horspool_searcher`
741///
742/// Currently the following compilers define this function template in C++17 or
743/// later modes:
744///
745/// * GCC 8.3.0
746/// * Microsoft Visual Studio 2019 / MSVC 19.20
747/// * clang 3.0 with GNU library
748///
749/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_search_overload}
750///
751///
752/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD` macro is defined if
753/// `<algorithm>` defines an overload for the `search` function template that
754/// accepts instances of the searcher classes introduced in C++17. See
755/// [alg.search]:
756/// @code
757/// template<class ForwardIterator, class Searcher>
758/// constexpr ForwardIterator std::search(ForwardIterator first,
759/// ForwardIterator last,
760/// const Searcher& searcher);
761/// @endcode
762///
763/// Currently the following compilers define this function template in C++17 or
764/// later modes:
765///
766/// * GCC 8.3.0
767/// * Microsoft Visual Studio 2017 / MSVC 19.10
768/// * clang above 3.0 with GNU library
769/// * Apple clang all supported versions
770///
771/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_deprecated_removed}
772///
773///
774/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED` macro is defined for
775/// libraries that do not export names removed in C++17, such as `std::ptr_fun`.
776/// `BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED` is generally the
777/// negation of `BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR`. Although the removal
778/// of deprecated C++17 types is conceptually equivalent to
779/// `__cplusplus >= 201703L`, standard library implementations often provide
780/// configuration flags to expose the deprecated library features.
781///
782/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_deprecated_removed}
783///
784///
785/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED` macro is defined for
786/// libraries that do not export names removed in C++20, such as
787/// `std::uncaught_exception`. Although the removal of deprecated C++20 types
788/// is conceptually equivalent to `__cplusplus >= 202002L`, some standard
789/// library implementations may continue to expose the features, and some may
790/// provide configuration flags to expose the deprecated library features.
791///
792/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_program_termination}
793///
794///
795/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION` macro is defined if
796/// of the listed conditions are true:
797///
798/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
799/// * The following functions are provided by the native standard library in
800/// the `<cstdlib>` header:
801/// * `_Exit`
802/// * @ref quick_exit
803/// * `at_quick_exit`
804///
805/// This macro is defined first for the following compiler versions:
806///
807/// * GCC 4.8
808/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
809/// * Microsoft Visual Studio 2015 / MSVC 19.00
810///
811/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_range_functions}
812///
813///
814/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS` is defined if the
815/// following functions are provided by the native standard library in the
816/// `<iterator>` header:
817///
818/// @code
819/// template <class C> auto begin(C& c) -> decltype(c.begin());
820/// template <class C> auto begin(const C& c) -> decltype(c.begin());
821/// template <class C> auto end(C& c) -> decltype(c.end());
822/// template <class C> auto end(const C& c) -> decltype(c.end());
823/// template <class T, size_t N> T* begin(T (&array)[N]);
824/// template <class T, size_t N> T* end(T (&array)[N]);
825/// @endcode
826///
827/// This macro is defined first for the following compiler versions:
828///
829/// * GCC 4.6
830/// * clang 3.0
831/// * Microsoft Visual Studio 2012 / MSVC 17.00
832///
833/// ## BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_range_functions}
834///
835///
836/// The `BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS` macro is defined if the
837/// following functions are provided by the native standard library in the
838/// `<iterator>` header:
839///
840/// @code
841/// template <class C> auto cbegin(const C& c) -> decltype(std::begin(c));
842/// template <class C> auto cend( const C& c) -> decltype(std::end(c));
843///
844/// template <class C> auto rbegin( C& c) -> decltype(c.rbegin());
845/// template <class C> auto rbegin(const C& c) -> decltype(c.rbegin());
846///
847/// template <class C> auto rend( C& c) -> decltype(c.rend());
848/// template <class C> auto rend(const C& c) -> decltype(c.rend());
849///
850/// template <class T, size_t N> reverse_iterator<T*> rbegin(T (&array)[N]);
851/// template <class T, size_t N> reverse_iterator<T*> rend( T (&array)[N]);
852///
853/// template <class E> reverse_iterator<const E*> rbegin(initializer_list<E>);
854/// template <class E> reverse_iterator<const E*> rend( initializer_list<E>);
855///
856/// template <class C> auto crbegin(const C& c) -> decltype(std::rbegin(c));
857/// template <class C> auto crend( const C& c) -> decltype(std::rend(c));
858/// @endcode
859///
860/// This macro is defined first for the following compiler versions:
861///
862/// * GCC 4.9
863/// * clang 3.4
864/// * Microsoft Visual Studio 2015 / MSVC 19.00
865///
866/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_stream_move}
867///
868///
869/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE` is defined if the standard
870/// stream classes (@ref basic_istream , @ref basic_ostream , @ref basic_stream ) all have
871/// the C++11 mandated move operations (constructor and assignment operator)
872/// defined. Notice that the this macro is separate from the macro
873/// `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` as standard library
874/// implementations exist that implement almost all of C++11 (which is detected
875/// by the `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro) but not this
876/// feature. Note that when `BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE` is
877/// defined `BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES` will also be
878/// defined, as the standard feature cannot be implemented without rvalue
879/// reference support from the compiler.
880///
881/// * Supported by the compiler vendor's STL implementation
882/// - GCC 5.0
883/// - clang 3.0
884/// - Microsoft Visual Studio 2015 / MSVC 19.00
885///
886/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_tuple}
887///
888///
889/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE` macro is defined if *both* of the
890/// listed conditions are true:
891///
892/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
893/// * The `tuple` type template (defined in `<tuple>`) is provided by the
894/// native standard library.
895/// * The `BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES` macro is also
896/// defined.
897///
898/// This macro is defined first for the following compiler versions:
899///
900/// * GCC 4.8
901/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
902/// * Microsoft Visual Studio 2015 / MSVC 19.00
903///
904/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_unique_ptr}
905///
906///
907/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR` macro is defined if *both*
908/// of the listed conditions are true:
909///
910/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
911/// * The `unique_ptr` class template (defined in `<memory>`) is provided by
912/// the native standard library.
913/// * The `BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES` macro is also
914/// defined.
915///
916/// This macro is defined first for the following compiler versions:
917///
918/// * GCC 4.8
919/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
920/// * Microsoft Visual Studio 2015 / MSVC 19.00
921///
922/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT: !NOT DEFINED! {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_bool_constant-not-defined}
923///
924///
925/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT` macro is never defined
926/// and is mentioned in this component as documentation until its appearance in
927/// several BDE test drivers is removed.
928///
929/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT` macro was intended to
930/// indicate whether or not the @ref bool_constant alias template (defined in
931/// `<type_traits>`) is provided by the native standard library. It has since
932/// been discovered that, as `bsl::integral_constant` is actually a distinct
933/// class template derived from `std::integral_constant`, there must always be a
934/// distinct `bsl` alias template, which will be provided in a future BDE
935/// release. Given this new direction, the need for a macro for the native type
936/// is obviated so `BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT` is being
937/// removed.
938///
939/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_range_functions}
940///
941///
942/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS` macro is defined if the
943/// following functions are provided by the native standard library in the
944/// `<iterator>` header:
945///
946/// @code
947/// template <class C> auto empty(const C& c) -> decltype(c.empty());
948/// template <class C> auto data( const C& c) -> decltype(c.data());
949/// template <class C> auto size( const C& c) -> decltype(c.size());
950/// @endcode
951///
952/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_aligned_alloc}
953///
954///
955/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC` macro is defined if the
956/// native standard library provides `std::aligned_alloc`.
957///
958/// Both libstdc++ and libc++ will provide this call if the underlying C library
959/// provides the global call '::aligned_alloc. This call is available on RedHat
960/// version 7, for example, but not on RedHat 6. Microsoft does not provide
961/// this call. See https://github.com/microsoft/STL/issues/2176
962///
963/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_timespec_get}
964///
965///
966/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET` macro is defined if the
967/// native standard library provides `std::timespec_get`.
968///
969/// Both libstdc++ and libc++ will provide this call if the underlying C library
970/// provides the global call '::timespec_get. This call is available on RedHat
971/// version 7, for example, but not on RedHat 6.
972///
973/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_special_math_functions}
974///
975///
976/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS` is defined if
977/// the special math functions such as `std::assoc_laguerre`, `std::beta` and
978/// others are provided by the native standard library in the `<cmath>` header.
979///
980/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_int_charconv}
981///
982///
983/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV` macro is defined if the
984/// native standard library provides the `<charconv>` header and implements both
985/// `std::from_chars` and `std::to_chars` for all standard signed and unsigned
986/// integer types and the `char` type, as well as the `std::to_chars_result` and
987/// `std::from_chars_result` types.
988///
989/// This macro is defined first for the following compiler versions:
990///
991/// - GCC 8
992/// - clang using at least GCC 8 GNU C++ Library
993/// - Microsoft Visual Studio 2017 / MSVC 19.10
994///
995/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_charconv}
996///
997///
998/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV` macro is defined if the native
999/// standard library provides the `<charconv>` header and implements all
1000/// required content with no major issues. This macro is defined in addition to
1001/// the `BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV` macro when the native
1002/// standard library also implements the `std::chars_format` enumeration, and
1003/// both `std::from_chars` and `std::to_chars` functions for all 3 standard
1004/// floating point types (`float`, `double`, `long double`).
1005///
1006/// This macro is defined first for the following compiler versions:
1007///
1008/// - GCC 12
1009/// - clang using at least GCC 12 GNU C++ Library
1010/// - Microsoft Visual Studio 2019 / MSVC 19.20
1011///
1012/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_filesystem}
1013///
1014///
1015/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM` macro is defined if the
1016/// native standard library provides the `<filesystem>` header and implements
1017/// all required content with no major issues.
1018///
1019/// This macro is defined first for the following compiler versions:
1020///
1021/// - GCC 9
1022/// - clang 14, or clang using at least GCC 9 GNU C++ Library
1023/// - Microsoft Visual Studio 2017 15.7 / MSVC 19.14
1024///
1025/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_PMR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_pmr}
1026///
1027///
1028/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_PMR` macro is defined if the
1029/// native standard library provides the `<memory_resource>` header and
1030/// implements all required content with no major issues.
1031///
1032/// This macro is defined first for the following stdlib versions:
1033///
1034/// - GNU libstdc++ v 9
1035/// - LLVM libc++ v 16
1036/// - MSVC++ STL v 15.6 (VS 2017)
1037///
1038/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_pmr_string}
1039///
1040///
1041/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING` macro is defined if the
1042/// native standard library provides the `pmr::basic_string` class template with
1043/// no major issues.
1044///
1045/// Usually `pmr::string` is available if the PMR feature is available. But GNU
1046/// libstdc++ doesn't provide it for the obsolete pre-C++11 CoW string
1047/// implemetation (`_GLIBCXX_USE_CXX11_ABI` == 0).
1048///
1049/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_version}
1050///
1051///
1052/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION` macro is defined if the native
1053/// standard library provides the `<version>` header and implements all required
1054/// content with no major issues.
1055///
1056/// A new header, `<version>`, that defines library feature-test macros has been
1057/// added in C++20. For better compatibility with the standard library
1058/// `BSLS_LIBRARYFEATURES` macros should be based on the standard feature test
1059/// macro when it is appropriate. See the "STANDARD FEATURE-DETECTION MACROS"
1060/// section below.
1061///
1062/// This macro is defined first for the following compiler versions:
1063///
1064/// - GCC 9
1065/// - clang 7, or clang using at least GCC 9 GNU C++ Library
1066/// - Microsoft Visual Studio 2019 16.2 / MSVC 19.22
1067///
1068/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_concepts}
1069///
1070///
1071/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS` macro is defined if the native
1072/// standard library provides the `<concepts>` header and implements all
1073/// required content with no major issues.
1074///
1075/// This macro is defined if the standard `__cpp_lib_concepts` feature-test
1076/// macro is defined and `__cpp_lib_concepts >= 202002L`.
1077///
1078/// This macro is defined first for the following compiler versions:
1079///
1080/// - GCC 11.1
1081/// - clang 15 when compiling against either:
1082/// - libc++ version 15, or
1083/// - libstdc++ version 11
1084/// - Microsoft Visual Studio 2022 17.2 / MSVC 19.32
1085///
1086/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_ranges}
1087///
1088///
1089/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES` macro is defined if the native
1090/// standard library provides the `<ranges>` header and implements all required
1091/// C++20 content with no major issues.
1092///
1093/// This macro is defined if the standard `__cpp_lib_ranges` feature-test macro
1094/// is defined and `__cpp_lib_ranges >= 202110L`.
1095///
1096/// This macro is defined first for the following compiler versions:
1097///
1098/// - GCC 12.1
1099/// - clang 15 when compiling against libc++ version 15
1100/// - clang 16 when compiling against
1101/// - libc++ version 16, or
1102/// - libstdc++ version 12
1103/// - Microsoft Visual Studio 2022 17.2 / MSVC 19.32
1104///
1105/// Note that GCC 11 ranges support is incomplete, as it is missing a number of
1106/// key Defect Report fixes, notably P2259R1, P2210R2, P2432R1, and P2415R2,
1107/// the latter being a breaking change between GCC 11 and GCC 12.
1108///
1109/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_SOURCE_LOCATION {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_source_location}
1110///
1111///
1112/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_SOURCE_LOCATION` macro is defined if the
1113/// native standard library provides the `<source_location>` header and
1114/// implements all required C++20 content with no major issues.
1115///
1116/// This macro is defined if the standard `__cpp_lib_source_location`
1117/// feature-test macro is defined and `__cpp_lib_source_location >= 201907L`.
1118///
1119/// This macro is defined first for the following compiler versions:
1120///
1121/// - GCC 11.1
1122/// - clang 15 when compiling against either:
1123/// - libc++ version 16, or
1124/// - libstdc++ version 11
1125/// - Microsoft Visual Studio 2022 / MSVC 19.30
1126///
1127/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_REF {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_ref}
1128///
1129///
1130/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_REF` macro is defined if the
1131/// `bsl::atomic_ref` type is available with C++20 semantics.
1132///
1133/// This macro is defined if the standard `__cpp_lib_atomic_ref`
1134/// feature-test macro is defined and `__cpp_lib_atomic_ref >= 201806L`.
1135///
1136/// This macro is defined first for the following compiler versions:
1137///
1138/// - GCC 11.1
1139/// - clang 15 when compiling against libstdc++ version 11
1140/// - Microsoft Visual Studio 2022 / MSVC 19.30
1141///
1142/// (no curent version of libc++ supports this feature)
1143///
1144/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_LOCK_FREE_TYPE_ALIASES {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_lock_free_type_aliases}
1145///
1146///
1147/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_LOCK_FREE_TYPE_ALIASES` macro is
1148/// defined if `bsl::atomic_signed_lock_free` and
1149/// `bsl:atomic_unsigned_lock_free` types are available with C++20 semantics.
1150///
1151/// This macro is defined if the standard
1152/// `__cpp_lib_atomic_lock_free_type_aliases` feature-test macro is defined.
1153///
1154/// This macro is defined first for the following compiler versions:
1155///
1156/// - GCC 13.1
1157/// - Microsoft Visual Studio 2022 / MSVC 19.30
1158///
1159/// (no curent version of clang supports this feature)
1160///
1161/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_WAIT_FREE_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_wait_free_functions}
1162///
1163///
1164/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_WAIT_FREE_FUNCTIONS` is defined
1165/// if the following free functions are available: `bsl::atomic_flag_wait`,
1166/// `bsl::atomic_flag_wait_explicit`, `bsl::atomic_flag_notify_one`,
1167/// `bsl::atomic_flag_notify_all` with C++20 semantics.
1168///
1169/// This macro is defined if the standard `__cpp_lib_atomic_wait` feature-test
1170/// macro is defined and has a value of at least 201907L.
1171///
1172/// This macro is defined first for the following compiler versions:
1173///
1174/// - clang 15 when compiling against libc++ version 15, or
1175/// - Microsoft Visual Studio 2022 / MSVC 19.30
1176///
1177/// (no current version of GCC supports this feature)
1178///
1179/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_FLAG_TEST_FREE_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_flag_test_free_functions}
1180///
1181///
1182/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_FLAG_TEST_FREE_FUNCTIONS` is
1183/// defined if the `bsl::atomic_flag_test` and `bsl::atomic_flag_test_explicit`
1184/// functions are available with C++20 semantics.
1185///
1186/// This macro is defined if the standard `__cpp_lib_atomic_flag_test`
1187/// feature-test macro is defined and has a value of at least 201907L.
1188///
1189/// This macro is defined first for the following compiler versions:
1190///
1191/// - clang 15 when compiling against libc++ version 15, or
1192/// - Microsoft Visual Studio 2022 / MSVC 19.30
1193///
1194/// (no current version of GCC supports this feature)
1195///
1196/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_MAKE_UNIQUE_FOR_OVERWRITE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_make_unique_for_overwrite}
1197///
1198///
1199/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_MAKE_UNIQUE_FOR_OVERWRITE` macro is
1200/// defined if the `bsl::make_unique_for_overwrite` function is available with
1201/// C++20 semantics.
1202///
1203/// This macro is defined first for the following compiler versions:
1204///
1205/// - GCC 11.1
1206/// - clang 15 when compiling against either:
1207/// - libc++ version 15, or
1208/// - libstdc++ version 11
1209/// - Microsoft Visual Studio 2022 / MSVC 19.30
1210///
1211/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_CALENDAR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_calendar}
1212///
1213///
1214/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_CALENDAR` is defined if the C++20
1215/// Calendar/TZ feature is available in `bsl::chrono` namespace.
1216///
1217/// This macro is defined if the standard `__cpp_lib_chrono` feature-test macro
1218/// has at least `201907L` value.
1219///
1220/// This macro is defined first for the following compiler versions:
1221///
1222/// - Microsoft Visual Studio 2022 / MSVC 19.30
1223///
1224/// (no current version of GCC or clang supports this feature)
1225///
1226/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_CHAR8_MB_CONV {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_char8_mb_conv}
1227///
1228///
1229/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_CHAR8_MB_CONV` macro is defined if the
1230/// `bsl::mbrtoc8` and `bsl::c8rtomb` functions are available with C++20
1231/// semantics.
1232///
1233/// (no current version of GCC, clang or MSVC supports this feature
1234///
1235/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_is_layout_compatible}
1236///
1237///
1238/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE` is defined if the
1239/// `bsl::is_layout_compatible` meta function is available.
1240///
1241/// Note that the standard feature test macro `__cpp_lib_is_layout_compatible`
1242/// is also defined and has a value of at least `201907L`.
1243///
1244/// This macro is defined first for the following compiler versions:
1245///
1246/// - GCC 12.1
1247/// - Microsoft Visual Studio 2022 / MSVC 19.30
1248///
1249/// (no current version of clang supports this feature)
1250///
1251/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_IS_CORRESPONDING_MEMBER {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_is_corresponding_member}
1252///
1253///
1254/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_IS_CORRESPONDING_MEMBER` is defined if
1255/// the `bsl::is_corresponding_member` meta function is available.
1256///
1257/// Note that the standard feature test macro `__cpp_lib_is_layout_compatible`,
1258/// the macro that informs
1259/// `BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE`, is also defined. See
1260/// the last sentence of `P0466R5`.
1261///
1262/// This macro is defined first for the following compiler versions:
1263///
1264/// - GCC 12.1
1265/// - Microsoft Visual Studio 2022 / MSVC 19.30
1266///
1267/// (no current version of clang supports this feature)
1268///
1269/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_IS_POINTER_INTERCONVERTIBLE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_is_pointer_interconvertible}
1270///
1271///
1272/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_IS_POINTER_INTERCONVERTIBLE` is defined
1273/// if the `bsl::is_pointer_interconvertible_base_of` and
1274/// `bsl::is_pointer_interconvertible_with_class` meta functions are available.
1275///
1276/// Note that the standard feature test macro
1277/// `__cpp_lib_is_pointer_interconvertible` is also defined and has a value of
1278/// at least `201907L`.
1279///
1280/// This macro is defined first for the following compiler versions:
1281///
1282/// - GCC 12.1
1283/// - Microsoft Visual Studio 2022 / MSVC 19.30
1284///
1285/// (no current version of clang supports this feature)
1286///
1287/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_JTHREAD {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_jthread}
1288///
1289///
1290/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_JTHREAD` is defined if the C++20
1291/// `bsl::jthread` class in the `<bsl_thread.h>` header available.
1292///
1293/// Note that the standard feature test macro `__cpp_lib_jthread` is also
1294/// defined and has a value of at least `201911L`.
1295///
1296/// This macro is defined first for the following compiler versions:
1297///
1298/// - GCC 10.1
1299/// - Microsoft Visual Studio 2019 Update 9 / <u>MSC</u>FULL_VER 192829913
1300/// - clang 18.0 with -fexperimental-library
1301///
1302/// ## BSLS_LIBRARYFEATURES_STDCPP_GNU {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_gnu}
1303///
1304///
1305/// The `BSLS_LIBRARYFEATURES_STDCPP_GNU` macro is defined if the C++ standard
1306/// library implementation is GNU libstdc++.
1307///
1308/// ## BSLS_LIBRARYFEATURES_STDCPP_IBM {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_ibm}
1309///
1310///
1311/// The `BSLS_LIBRARYFEATURES_STDCPP_IBM` macro is defined if the C++ standard
1312/// library implementation is IBM's VACPP.
1313///
1314/// ## BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_intellisense}
1315///
1316///
1317/// The `BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE` macro is defined if
1318/// Microsoft's Intellisense is running (instead of a production compiler).
1319/// Note that detecting Intellisense does *not* mean that the MSVC compiler is
1320/// used. Visual Studio 2017 is capable of cross platform development using
1321/// clang and Visual Studio Code (also featuring Intellisense) may be used with
1322/// virtually any compiler.
1323///
1324/// ## BSLS_LIBRARYFEATURES_STDCPP_LLVM {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_llvm}
1325///
1326///
1327/// The `BSLS_LIBRARYFEATURES_STDCPP_LLVM_LIBCPP` macro is defined if the C++
1328/// standard library implementation is LLVM's libc++.
1329///
1330/// ## BSLS_LIBRARYFEATURES_STDCPP_MSVC {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_msvc}
1331///
1332///
1333/// The `BSLS_LIBRARYFEATURES_STDCPP_MSVC` macro is defined if the C++ standard
1334/// library implementation is Microsoft's (Dinkumware based) implementation.
1335///
1336/// ## BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_libcstd}
1337///
1338///
1339/// The `BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD` macro is defined if the C++
1340/// standard library implementation is a RogueWave implementation.
1341///
1342/// ## BSLS_LIBRARYFEATURES_STDCPP_STLPORT {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_stlport}
1343///
1344///
1345/// The `BSLS_LIBRARYFEATURES_STDCPP_STLPORT` macro is defined if the C++
1346/// standard library implementation is an STLPort implementation.
1347///
1348/// ## Usage {#bsls_libraryfeatures-usage}
1349///
1350///
1351/// In this section we show intended usage of this component.
1352///
1353/// ### Example 1: Managing Library-Dependent Interfaces {#bsls_libraryfeatures-example-1-managing-library-dependent-interfaces}
1354///
1355///
1356/// When building software across multiple platforms a programmer may have to
1357/// deal with different versions of the native standard library, some providing
1358/// features that the others do not. The macros defined in this component can
1359/// be used make features visible only if the required native standard library
1360/// features are present.
1361///
1362/// For example, the `tuple`-type is not available in older versions of the
1363/// native standard library. Suppose we have a utility component that returns
1364/// an instance of a `tuple` of values *if* the underlying version of the
1365/// standard library provides that type, and yet remain compilable otherwise.
1366///
1367/// First, we conditionally include the header file we will need if we define an
1368/// interface that returns a `std::tuple`.
1369/// @code
1370/// #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE)
1371/// #ifndef INCLUDED_TUPLE
1372/// #include <tuple>
1373/// #define INCLUDED_TUPLE
1374/// #endif
1375/// #endif // BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
1376/// @endcode
1377/// Then, we declare the methods that will be unconditionally provided by our
1378/// utility component:
1379/// @code
1380/// struct MyStatisticalUtil
1381/// {
1382/// static double mean(const int *begin, const int *end);
1383/// static int median(const int *begin, const int *end);
1384/// static double variance(const int *begin, const int *end);
1385/// // Return the median (mean, variance) of the sequence of values in
1386/// // the specified non-empty, semi-open range '[begin, end)'. The
1387/// // behavior is undefined unless 'begin < end'.
1388/// @endcode
1389/// Now, we conditionally define an interface that returns a `bsl::type`, if
1390/// that type is available. Note that, if all three values are needed, calling
1391/// this interface is more efficient than calling the earlier three individually
1392/// because the input need be traversed one time, not three.
1393/// @code
1394/// #ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
1395/// static std::tuple<int, double, double> getMedianMeanVariance(
1396/// const int *begin,
1397/// const int *end);
1398/// // Return the median, mean, and variance (in that order) of the
1399/// // sequence of values in the specified non-empty, semi-open range
1400/// // '[begin, end)'. The behavior is undefined unless 'begin < end'.
1401///
1402/// #endif // BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
1403///
1404/// };
1405/// @endcode
1406/// Finally, we find that our code compiles when we build our code against
1407/// versions of the native standard library that provide a `tuple` type, *and*
1408/// those that do not. Of course, in the later case the interface that returns
1409/// @}
1410/** @} */
1411/** @} */
1412
1413/** @addtogroup bsl
1414 * @{
1415 */
1416/** @addtogroup bsls
1417 * @{
1418 */
1419/** @addtogroup bsls_libraryfeatures
1420 * @{
1421 */
1422
1423#include <bsls_compilerfeatures.h>
1424#include <bsls_platform.h>
1425#include <bsls_linkcoercion.h>
1426
1427// ============================================================================
1428// STANDARD LIBRARY DETECTION
1429// ----------------------------------------------------------------------------
1430
1431#define BSLS_LIBRARYFEATURES_DETECTION_IN_PROGRESS
1432// We are including a *standard* header to get the macros defined that allow us
1433// to determine what standard library implementation we have. Do *not* change
1434// these to any other header. These headers were selected because they do not
1435// include (m)any other standard headers *and* they do not define any dangerous
1436// (non-uppercase) macros. '<ciso646>' would define dangerous macros on
1437// Microsoft platform, so we use the standard header '<cstddef>' to get to the
1438// platform-determining macros. '<ciso646>' is effectively empty on older GNU
1439// implementations, so we also include '<cstddef>'.
1440
1441#ifdef BSLS_COMPILERFEATURES_SUPPORT_HAS_INCLUDE
1442// On platforms that support it we use '__has_include' to give a better error
1443// message if/when our assumptions about the platforms and its supported header
1444// files break.
1445
1446// First we determine if we have clang that uses the GNU library. We need this
1447// info because for the GNU library we need to include a different header, not
1448// '<ciso646>', because '<ciso646>' does not define the required macros prior
1449// to version 6.1. See http://en.cppreference.com/w/cpp/header/ciso646
1450
1451 #if defined(BSLS_PLATFORM_CMP_CLANG)
1452 #if __has_include(<bits/c++config.h>)
1453 #define BSLS_LIBRARYFEATURES_SUSPECT_CLANG_WITH_GLIBCPP 1
1454 #endif
1455 #endif
1456
1457 #ifdef BSLS_PLATFORM_CMP_MSVC
1458 #if !__has_include(<yvals.h>)
1459 #error Standard library implementation detection is broken.
1460 // The implementation specific header file <yvals.h> we assumed
1461 // exists is not found. This may be the result of either a new
1462 // major library version from Microsoft (that breaks with
1463 // tradition), or an unexpected standard library implementation
1464 // being used with the Microsoft compiler instead of the usual
1465 // Microsoft implementation. This detection logic needs to be
1466 // updated to also support this new situation.
1467 #endif
1468
1469 #elif defined(BSLS_PLATFORM_CMP_GNU) || \
1470 defined(BSLS_LIBRARYFEATURES_SUSPECT_CLANG_WITH_GLIBCPP)
1471 #if !__has_include(<bits/c++config.h>)
1472 #error Standard library implementation detection is broken.
1473 // The implementation specific header file <bits/c++config.h> we
1474 // assumed exists is not found. This may be the result of either
1475 // a new major C++ library version from GNU (that breaks with
1476 // tradition), or an unexpected standard library implementation
1477 // being used with the GNU compiler instead of the usual libstdc++.
1478 // This detection logic needs to be updated to also support this
1479 // new situation.
1480 #endif
1481
1482 #elif defined(BSLS_PLATFORM_CMP_SUN)
1483 #if !__has_include(<valarray>)
1484 #error Standard library implementation detection has failed.
1485 BSLS_PLATFORM_COMPILER_ERROR; // Sun ignores '#error'
1486 // The implementation specific header file <valarray> we assumed
1487 // exists is not found. Since '<valarray>' is in every ISO C++
1488 // standard (library) it is very likely that this error is caused
1489 // by a broken build configuration, such as trying to compile C++
1490 // source code files as C, or some other reason why the compiler
1491 // cannot see the C++ standard library header files.
1492 #endif
1493
1494 #elif BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
1495 #if !__has_include(<version>)
1496 #error Standard library implementation detection is broken.
1497 // The implementation specific header file <version> we assumed
1498 // exists is not found. Since '<version>' is part of ISO C++2020
1499 // standard (library) it is very likely that this error is caused
1500 // by either a broken build configuration, or this untested
1501 // compiler reporting C++20 compatibility that it does not have.
1502 // Build configuration issues may be trying to compile a C++
1503 // source code files as C, or some other reason why the compiler
1504 // cannot see the C++ standard library header files. If that is
1505 // not the case this detection logic has to be extended to support
1506 // this failing build platform.
1507 #endif
1508 #else
1509 #if !__has_include(<ciso646>)
1510 #error Standard library implementation detection is broken.
1511 // The implementation specific header file <ciso646> we assumed
1512 // exists is not found. Since '<ciso646>' part of every ISO C++
1513 // standard (library) before C++20 it is very likely that this
1514 // error is caused by a broken build configuration, such as trying
1515 // to compile C++ source code files as C, or some other reason why
1516 // the compiler cannot see the C++ standard library header files.
1517 // If that is not the case this detection logic has to be extended
1518 // to support this failing build platform.
1519 #endif
1520 #endif
1521
1522#endif // '__has_include' is supported
1523
1524// Include a header from the standard library implementation that defines the
1525// macros that we use for detection, and is "cheap" either because most headers
1526// of the implementation will '#include' it, or because it is a relatively
1527// small header.
1528
1529#ifdef BSLS_PLATFORM_CMP_MSVC
1530 #include <cstddef>
1531#elif defined(BSLS_PLATFORM_CMP_GNU) || \
1532 defined(BSLS_LIBRARYFEATURES_SUSPECT_CLANG_WITH_GLIBCPP)
1533 #include <cstddef>
1534 #if defined(BSLS_LIBRARYFEATURES_SUSPECT_CLANG_WITH_GLIBCPP)
1535 // Prevent macro pollution
1536 #undef BSLS_LIBRARYFEATURES_SUSPECT_CLANG_WITH_GLIBCPP
1537 #endif
1538#elif defined(BSLS_PLATFORM_CMP_SUN)
1539 // Unfortunately, SUN does *nothing* in its '<ciso646>', or its
1540 // '<exception>' headers. Its '<new>', and '<typeinfo>' headers are
1541 // shared between the RogueWave and the STLPort implementations, so they
1542 // do not define anything standard library specific (see
1543 // https://docs.oracle.com/cd/E19205-01/819-5267/6n7c46e4p/index.html
1544 // 12.7.1), therefore we have to include something that is different
1545 // between RogueWave and STLPort implementations. All such headers are
1546 // large, not cheap. :(
1547
1548 #include <valarray>
1549#else
1550 #include <ciso646>
1551#endif
1552#undef BSLS_LIBRARYFEATURES_DETECTION_IN_PROGRESS
1553
1554// The implementation detection logic itself. Note that on IBM we just detect
1555// the compiler, because the IBM library does not define a specific version
1556// macro.
1557
1558#if defined (__GLIBCPP__) || defined(__GLIBCXX__)
1559 #define BSLS_LIBRARYFEATURES_STDCPP_GNU 1
1560#elif defined(_CPPLIB_VER) || (defined(_YVALS) && !defined(__IBMCPP__))
1561 #define BSLS_LIBRARYFEATURES_STDCPP_MSVC 1
1562#elif defined(_LIBCPP_VERSION)
1563 #define BSLS_LIBRARYFEATURES_STDCPP_LLVM 1
1564#elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
1565 #define BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD 1
1566#elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
1567 #define BSLS_LIBRARYFEATURES_STDCPP_STLPORT 1
1568#elif defined(__IBMCPP__)
1569 #define BSLS_LIBRARYFEATURES_STDCPP_IBM 1
1570#elif defined(__INTELLISENSE__)
1571 #define BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE 1
1572#else
1573 #error Could not determine standard library platform.
1574#endif
1575
1576// ============================================================================
1577// UNIVERSAL FEATURE SUPPORT DEFINITIONS
1578// ----------------------------------------------------------------------------
1579
1580// Define macros for C++98 features that may be detected as absent from later
1581// standards. All removed libraries will have their macros undefined in a
1582// consistent manner at the end of this header
1583
1584/// Set unconditionally for compilers supporting an earlier standard than
1585/// C++14; this feature macro will be undefined for those platforms with
1586/// partial support for C++14, implementing the removal of this dangerous
1587/// function.
1588#define BSLS_LIBRARYFEATURES_HAS_C90_GETS 1
1589
1590/// Set unconditionally. This features is found on each compiler
1591/// version/platform combination tested. Assume universally available until
1592/// the day tool chains start removing this deprecated class template.
1593#define BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR 1
1594
1595#if BSLS_COMPILERFEATURES_CPLUSPLUS < 202002L
1596 /// These APIs should be removed in C++20. Undefined conditionally
1597 /// later in this file for implementations that still have it.
1598 #define BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API 1
1599#endif
1600
1601#if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201703L
1602 /// These APIs should be removed in C++17. Undefined conditionally
1603 /// later in this file for implementations that still have it.
1604 #define BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED 1
1605#endif
1606
1607#if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
1608 /// These APIs should be removed in C++20. Undefined conditionally
1609 /// later in this file for implementations that still have it.
1610 #define BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED 1
1611#endif
1612
1613// ============================================================================
1614// PLATFORM SPECIFIC FEATURE DETECTION
1615// ----------------------------------------------------------------------------
1616
1617#if defined(BSLS_PLATFORM_CMP_GNU)
1618 #define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY 1
1619 #if (__cplusplus >= 201103L) || \
1620 (defined(__GXX_EXPERIMENTAL_CXX0X__) && \
1621 BSLS_PLATFORM_CMP_VERSION >= 40800)
1622 // C99 functions are available in C++11 builds.
1623 #define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY 1
1624 #endif
1625 #if (__cplusplus >= 201103L) || \
1626 (defined(__GXX_EXPERIMENTAL_CXX0X__) && \
1627 BSLS_PLATFORM_CMP_VERSION >= 40800) || \
1628 (defined(_GLIBCXX_USE_C99) && _GLIBCXX_USE_C99 == 1)
1629 // snprintf is also available in C++03 builds with new gcc versions
1630
1631 #define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF 1
1632 #endif
1633 #if defined(__GXX_EXPERIMENTAL_CXX0X__) && (__cplusplus >= 201103L)
1634 #if BSLS_PLATFORM_CMP_VERSION >= 40600
1635 #define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS 1
1636 #endif
1637
1638 #if BSLS_PLATFORM_CMP_VERSION >= 40800
1639 #define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY 1
1640 #define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING 1
1641 #define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR 1
1642 #define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE 1
1643 #define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR 1
1644 #if defined(_GLIBCXX_HAVE_AT_QUICK_EXIT) && \
1645 defined(_GLIBCXX_HAVE_QUICK_EXIT)
1646 // This feature depends on GLIBC exposing support by defining
1647 // the above two pre-processor definitions.
1648 #define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION 1
1649 #endif
1650 #endif
1651
1652 #if BSLS_PLATFORM_CMP_VERSION >= 50000
1653 #define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES 1
1654 #define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE 1
1655 #endif
1656
1657 #if BSLS_PLATFORM_CMP_VERSION >= 60000
1658 #define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API 1
1659 #endif
1660 #endif
1661 #if __cplusplus > 201103L
1662 #define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY 1
1663 #define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS 1
1664 #endif
1665 #if __cplusplus > 201402L // > C++14
1666 #if BSLS_PLATFORM_CMP_VERSION >= 70301
1667 #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD 1
1668 #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS 1
1669 #endif
1670 #endif
1671 #if __cplusplus >= 201703L // At least C++17
1672 #if BSLS_PLATFORM_CMP_VERSION >= 70000
1673 #define BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY 1
1674 #define BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS 1
1675 #endif
1676 #if BSLS_PLATFORM_CMP_VERSION >= 80000
1677 #define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV 1
1678 #endif
1679 #if BSLS_PLATFORM_CMP_VERSION >= 90000
1680 #define BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM 1
1681 #ifdef BSLS_COMPILERFEATURES_SUPPORT_HAS_INCLUDE
1682 #if __has_include(<tbb/blocked-range.h>)
1683 // GCC 9 needs at least 2018 Intel Thread Building Blocks (TBB)
1684 // installed for full C++17 parallel algorithm support.
1685 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS 1
1686 #endif
1687 #endif
1688 #endif
1689 #if _GLIBCXX_RELEASE >= 9
1690 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR 1
1691 // Using production flag to temporary disable generic PMR support.
1692 #if _GLIBCXX_USE_CXX11_ABI
1693 // GNU libstdc++: no 'pmr::string' when pre-C++11 ABI is used
1694 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING 1
1695 #endif
1696 #endif
1697 #if BSLS_PLATFORM_CMP_VERSION >= 120000
1698 // GCC 11 ships FP <charconv> but slow and very buggy
1699 #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV 1
1700 #endif
1701 #ifdef _GLIBCXX_HAVE_TIMESPEC_GET
1702 #define BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET 1
1703 #endif
1704 #ifdef _GLIBCXX_HAVE_ALIGNED_ALLOC
1705 #define BSLS_LIBRARYFEATURES_HAS_CPP17__ALIGNED_ALLOC 1
1706 #endif
1707 #define BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS 1
1708 #endif
1709 #if __cplusplus >= 202002L // At least C++20
1710 #if BSLS_PLATFORM_CMP_VERSION >= 90000
1711 #define BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION 1
1712 #endif
1713 #if BSLS_PLATFORM_CMP_VERSION >= 110100
1714 #define BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY 1
1715 #endif
1716 #endif
1717
1718 // '__cpp_lib_atomic_is_always_lock_free' is defined in the '<version>'
1719 // header, and the '<atomic>' header. We prefer to include the '<version>'
1720 // header if it exists as it's not only a lot smaller and less complicated,
1721 // but also very likely to (already) be included anyway.
1722 #if __has_include(<version>)
1723 #include <version>
1724 #elif __has_include(<atomic>)
1725 #include <atomic>
1726 #endif
1727 #if defined(__cpp_lib_atomic_is_always_lock_free)
1728 // There is no pre-processor define declared in libstdc++ to indicate
1729 // that precise bitwidth atomics exist, but the libstdc++ shipping with
1730 // GCC 7 also includes lock-free support in C++17 mode. That feature
1731 // does include a pre-processor definition, so use it as a stand-in for
1732 // detecting precise bitwidth atomics. This pre-processor definition
1733 // will already only be defined when compiling in at least C++17
1734 // standard mode, so there is no need for an additional check.
1735 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS 1
1736 #endif
1737 #if _GLIBCXX_USE_DEPRECATED
1738 #undef BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
1739 #undef BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED
1740 #endif
1741#endif
1742
1743#if defined(BSLS_PLATFORM_CMP_IBM)
1744 // #define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY
1745 // #define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY
1746 // #define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF
1747 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
1748 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING
1749 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
1750 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES
1751 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
1752 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION
1753 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS
1754 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
1755 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
1756 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR
1757 // #define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY
1758 // #define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS
1759 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS
1760 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD
1761 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
1762#endif
1763
1764#if defined(BSLS_PLATFORM_CMP_SUN)
1765 #if __cplusplus >= 201103L
1766 // It would be simpler if we could simply identify as the corresponding
1767 // gcc library version: CC CMP_VERSION libstdc++ version
1768 // 12.4 0x5130 4.8.4
1769 // 12.5 0x5140 5.1.0
1770 // 12.6 0x5150 5.4.0
1771 #if BSLS_PLATFORM_CMP_VERSION >= 0x5130
1772 #define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY 1
1773 #define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY 1
1774 #define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF 1
1775 #define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY 1
1776 #define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING 1
1777 #define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR 1
1778 #define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS 1
1779 #define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE 1
1780 #define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE 1
1781 #define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR 1
1782 #endif
1783
1784 #if BSLS_PLATFORM_CMP_VERSION >= 0x5140
1785 #define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES 1
1786 #endif
1787
1788 #if BSLS_PLATFORM_CMP_VERSION >= 0x5150
1789 // Currently have an issue with rvalue-references on the CC 12.6
1790 // (beta) compiler, so undefining library feature macros that rely
1791 // on that language feature being marked as available
1792 #undef BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
1793 #undef BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
1794 #undef BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR
1795 #endif
1796 #endif
1797 #if __cplusplus > 201103L
1798 #if BSLS_PLATFORM_CMP_VERSION >= 0x5140
1799 #define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY 1
1800 #define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS 1
1801 #endif
1802 #endif
1803
1804 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
1805 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION
1806 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS
1807 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD
1808 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
1809#endif
1810
1811#if defined(BSLS_LIBRARYFEATURES_STDCPP_STLPORT)
1812 // #define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY
1813 // #define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY
1814 // #define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF
1815 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
1816 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING
1817 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
1818 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES
1819 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
1820 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION
1821 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
1822 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
1823 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR
1824 // #define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY
1825 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS
1826 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD
1827 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
1828#endif
1829
1830#if defined(BSLS_PLATFORM_CMP_CLANG)
1831
1832 #define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY 1
1833
1834 #if defined(__APPLE_CC__) && (__APPLE_CC__ >= 6000)
1835
1836 #define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS 1
1837 // libc++ provides this C++11 feature as a C++98 extension.
1838
1839 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (_LIBCPP_STD_VER >= 11)
1840 #define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY 1
1841 #define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF 1
1842 #endif
1843
1844 #if (defined(__GXX_EXPERIMENTAL_CXX0X__) || (_LIBCPP_STD_VER >= 11)) \
1845 && (__cplusplus >= 201103L)
1846 #define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY 1
1847 #define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING 1
1848 #define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR 1
1849 #define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE 1
1850 #define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR 1
1851 #endif
1852
1853 #if __cplusplus > 201103L
1854 #define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY 1
1855 #endif
1856
1857 #if __cplusplus >= 201402L
1858 #define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS 1
1859 #endif
1860
1861 #if __cplusplus >= 201703L
1862 #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD 1
1863
1864 #if BSLS_PLATFORM_CMP_VERSION >= 140000
1865 #define BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY 1
1866 #define BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS 1
1867 #define BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM 1
1868 #endif
1869
1870 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV
1871 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV
1872 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
1873 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS
1874 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS
1875 #endif
1876
1877 #if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
1878 #if BSLS_PLATFORM_CMP_VERSION >= 100000
1879 #define BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION 1
1880 #endif
1881
1882 #if BSLS_PLATFORM_CMP_VERSION >= 150000
1883 #define BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY 1
1884 #endif
1885 #endif
1886
1887 #elif BSLS_PLATFORM_CMP_VERSION >= 30000
1888
1889 #if defined(__GXX_EXPERIMENTAL_CXX0X__)
1890 #define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY 1
1891 #define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF 1
1892 #endif
1893
1894 #if defined(__GXX_EXPERIMENTAL_CXX0X__) && (__cplusplus >= 201103L)
1895 #define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY 1
1896 #define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS 1
1897 #define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING 1
1898 #if __cplusplus >= 201703L
1899 #define BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM 1
1900 #endif
1901 #define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR 1
1902 #define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE 1
1903 #define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE 1
1904 #define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR 1
1905
1906 #if defined(_GLIBCXX_HAVE_AT_QUICK_EXIT) && \
1907 defined(_GLIBCXX_HAVE_QUICK_EXIT)
1908 // Assume a minimum of a GCC 4.8 toolchain and check for GLIBC
1909 // support for the feature.
1910 #define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION 1
1911 #endif
1912 #endif
1913
1914
1915 // '__cpp_lib_atomic_is_always_lock_free' is defined in the '<version>'
1916 // header, and the '<atomic>' header. We prefer to include the
1917 // '<version>' header if it exists as it is not just a lot smaller and
1918 // less complicated, but also very likely to be included anyway.
1919 #if __has_include(<version>)
1920 #include <version>
1921 #elif __has_include(<atomic>)
1922 #include <atomic>
1923 #endif
1924 #if defined(__cpp_lib_atomic_is_always_lock_free)
1925 // There is no pre-processor define declared in libstdc++ to
1926 // indicate that precise bitwidth atomics exist, but the libstdc++
1927 // shipping with GCC 7 also includes lock-free support in C++17
1928 // mode. That feature does include a pre-processor definition, so
1929 // use it as a stand-in for detecting precise bitwidth atomics.
1930 // This pre-processor definition will already only be defined when
1931 // compiling in at least C++17 standard mode, so there is no need
1932 // for an additional check.
1933 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS 1
1934 #endif
1935
1936 #if __cplusplus > 201103L
1937 #if BSLS_PLATFORM_CMP_VERSION >= 30400
1938 #define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY 1
1939 #define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS 1
1940 #endif
1941 #endif
1942
1943 #if __cplusplus >= 201703L
1944 #define BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY 1
1945 #define BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS 1
1946 #if defined(BSLS_LIBRARYFEATURES_STDCPP_GNU)
1947 #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD 1
1948 #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS 1
1949
1950 #if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 8
1951 #define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV 1
1952 #endif
1953 #if defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 12
1954 // The FP <charconv> in GCC 11 is slow and buggy
1955 #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV 1
1956 #endif
1957 #elif defined(BSLS_LIBRARYFEATURES_STDCPP_LLVM)
1958 #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD 1
1959 #ifdef _LIBCPP_HAS_TIMESPEC_GET
1960 #define BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET 1
1961 #endif
1962 #ifdef _LIBCPP_HAS_ALIGNED_ALLOC
1963 #define BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC 1
1964 #endif
1965 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV
1966 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV
1967 #else
1968 #error Unsupported standard library for g++
1969 #endif
1970
1971 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS
1972 #endif
1973
1974 #if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
1975 #if BSLS_PLATFORM_CMP_VERSION >= 90000
1976 #define BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION 1
1977 #endif
1978
1979 #if BSLS_PLATFORM_CMP_VERSION >= 150000
1980 #if defined(BSLS_LIBRARYFEATURES_STDCPP_GNU) && \
1981 defined(_GLIBCXX_RELEASE) && _GLIBCXX_RELEASE >= 11
1982 #define BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY 1
1983 #elif defined(BSLS_LIBRARYFEATURES_STDCPP_LLVM) && \
1984 defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 150000
1985 #define BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY 1
1986 #endif
1987 #endif
1988 #endif
1989 #endif
1990
1991 #if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201703L && \
1992 (_GLIBCXX_RELEASE >= 9 || _LIBCPP_VERSION >= 170000)
1993 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR 1
1994 #if defined(_GLIBCXX_RELEASE)
1995 // GLIB logic as above for GNU
1996 #if _GLIBCXX_USE_CXX11_ABI
1997 // GNU libstdc++: no 'pmr::string' when pre-C++11 ABI is used
1998 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING 1
1999 #endif
2000 #else
2001 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING 1
2002 #endif
2003 #endif
2004
2005 // Do not define these until there is a pre-processor definition given by
2006 // the build system to indicate at least the major version number of the
2007 // GCC toolchain used by Clang.
2008 //
2009 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES
2010 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
2011
2012 #if _GLIBCXX_USE_DEPRECATED
2013 #undef BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
2014 #undef BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED
2015 #endif
2016#endif
2017
2018#if defined(BSLS_PLATFORM_CMP_MSVC)
2019
2020 // Visual Studio feature detection code is based on
2021 // https://docs.microsoft.com/en-us/cpp/overview/ ->
2022 // visual-cpp-language-conformance
2023
2024 // We assume at least Visual Studio 2015
2025 #define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY 1
2026 #define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY 1
2027 #define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY 1
2028 #define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE 1
2029 #define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES 1
2030 #define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS 1
2031 #define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS 1
2032 #define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR 1
2033 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS 1
2034 #define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF 1
2035 #define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING 1
2036 #define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API 1
2037 #define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR 1
2038 #define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION 1
2039 #define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE 1
2040 // Note that earlier versions have 'tuple' but this macro also
2041 // requires the definition of the
2042 // 'BSLS_COMPILER_FEATURES_HAS_VARIADIC_TEMPLATES' macro.
2043 #define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY 1
2044 #define BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT 1
2045 // Early access to C++17 features
2046
2047 #undef BSLS_LIBRARYFEATURES_HAS_C90_GETS
2048
2049 // C++14 support reported
2050 #if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201402L
2051
2052 // C++14 library features introduced in Visual Studio 2017
2053
2054 // VS 2017 15.0
2055 #if BSLS_PLATFORM_CMP_VERSION >= 1910
2056 #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD 1
2057 #endif
2058 #endif // At least C++14
2059
2060 // Possible C++17 support reported
2061 #if BSLS_COMPILERFEATURES_CPLUSPLUS > 201402L
2062
2063 // C++17 library features introduced in Visual Studio 2017
2064
2065 // VS 2017 15.6
2066 #if BSLS_PLATFORM_CMP_VERSION >= 1913
2067 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR 1
2068 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING 1
2069 #define BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS 1
2070 #endif
2071
2072 // VS 2017 15.7
2073 #if BSLS_PLATFORM_CMP_VERSION >= 1914
2074 #define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV 1
2075 #define BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM 1
2076 #define BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS 1
2077 #endif
2078
2079 // VS 2017 15.8
2080 #if BSLS_PLATFORM_CMP_VERSION >= 1915
2081 // MSVC 19.15 has the floating point <charconv>' functions but they
2082 // do not report under and overflow properly.
2083
2084 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV
2085 #endif
2086
2087 // C++17 library features introduced in Visual Studio 2019
2088
2089 // VS 2019 16.0
2090 #if BSLS_PLATFORM_CMP_VERSION >= 1920
2091 #define BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY 1
2092 #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV 1
2093 #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS 1
2094 #define BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS 1
2095 #define BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET 1
2096 #endif
2097 #endif // More than C++14 (there are C++17 features)
2098
2099 // C++20 support reported
2100
2101 #if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
2102
2103 // C++20 library features introduced in Visual Studio 2019
2104
2105 // VS 2019 16.2
2106 #if BSLS_PLATFORM_CMP_VERSION >= 1922
2107 #define BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION 1
2108 #endif
2109
2110 // C++20 library features introduced in Visual Studio 2022
2111
2112 // VS 2022 17.0.1
2113 #if BSLS_PLATFORM_CMP_VERSION >= 1930
2114 #define BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY 1
2115 #endif
2116 #endif // At least C++20
2117
2118 // If _HAS_AUTO_PTR_ETC is defined, use its value as the deciding one for
2119 // whether the C++17 deprecated names are gone.
2120 #if defined _HAS_AUTO_PTR_ETC
2121 #if _HAS_AUTO_PTR_ETC
2122 #undef BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
2123 #else
2124 #define BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED 1
2125 #endif
2126 #endif
2127
2128 // If _HAS_FEATURES_REMOVED_IN_CXX20 is defined, use its value as the
2129 // deciding one for whether the C++20 deprecated names are gone.
2130 #if defined _HAS_FEATURES_REMOVED_IN_CXX20
2131 #if _HAS_FEATURES_REMOVED_IN_CXX20
2132 #undef BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED
2133 #else
2134 #define BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED 1
2135 #endif
2136 #endif
2137#endif
2138
2139// ============================================================================
2140// POST-DETECTION FIXUPS
2141// ----------------------------------------------------------------------------
2142
2143// Now, after detecting support, unconditionally undefine macros for features
2144// that have been removed from later standards.
2145
2146#if BSLS_COMPILERFEATURES_CPLUSPLUS > 201103L
2147 // 'gets' is removed immediately from C++14, so undefine for any standard
2148 // version identifier greater than that of C++11.
2149 #undef BSLS_LIBRARYFEATURES_HAS_C90_GETS
2150#endif
2151
2152#if defined BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
2153 // 'auto_ptr' is removed from C++17, so undefine for any standard version
2154 // identifier greater than that of C++14.
2155 #undef BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR
2156#endif
2157
2158#if BSLS_COMPILERFEATURES_CPLUSPLUS > 202002L
2159 // The garbage collection support API is removed from C++23, so undefine
2160 // for any standard version identifier greater than that of C++20. Note
2161 // that some C++23 preview toolchains removed this API before the final
2162 // __cplusplus macro value for that standard was known, so we need to test
2163 // for "later standard than 2020".
2164 #undef BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
2165#endif
2166
2167// ============================================================================
2168// CONJUNCTION FEATURES
2169// ----------------------------------------------------------------------------
2170
2171// Now that we have detected and fixed up all features we may determine the
2172// presence of those that we know exist when their required features exist.
2173
2174#if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY) && \
2175 defined(BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES) && \
2176 defined(BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES)
2177
2178 #define BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE 1
2179#endif
2180
2181// ============================================================================
2182// STANDARD FEATURE-DETECTION-MACRO-BASED PROCESSING
2183// ----------------------------------------------------------------------------
2184
2185// Starting with C++20 '__cpp_lib_*' macros indicating the presence of C++
2186// Standard library features is guaranteed by the ISO standard. All such
2187// macros for the supported library features are guaranteed to be defined in
2188// the '<version>' standard header, and in additional headers related to the
2189// feature. This section defines our C++20 or later feature macros that are
2190// based on the standard feature macros. Note that one-to-one mapping is not
2191// guaranteed as we do not report any C++20 library functionality supported
2192// unless a minimum baseline of features are present. It may also be necessary
2193// for us to consider a feature not supported, despite the standard macro being
2194// set, if there are issues in a certain implementation that prevent effective
2195// and/or safe use within the BDE libraries.
2196
2197#ifdef BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION
2198 #include <version>
2199#endif
2200
2201#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION) && \
2202 defined(BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY)
2203 // Feature macros are defined by the '<version>' header, we do not test for
2204 // their existence unless the header exists. We make individual, additional
2205 // features available only when we claim to support the baseline c++20
2206 // standard library functionality. We have separated the actual inclusion of
2207 // '<version>' into its own, preceding, '#ifdef' block (and not embedded the
2208 // 'BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY' conditional block in it)
2209 // to avoid adding yet another level of indentation. The c++20 feature macro
2210 // names are long to be descriptive, which can result in crowded and hard to
2211 // read code even just with 2 spaces indentation.
2212
2213 #if defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L
2214 #define BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS 1
2215 #endif
2216
2217 #if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 202110L && \
2218 !(defined(BSLS_PLATFORM_CMP_CLANG) && \
2219 BSLS_PLATFORM_CMP_VERSION < 160000 && \
2220 defined(BSLS_LIBRARYFEATURES_STDCPP_GNU))
2221 // Clang 15 doesn't implement deferred instantiation of 'requires'
2222 // clauses, which is necessary to build libstdc++ ranges.
2223 #define BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES 1
2224 #endif
2225
2226 #if defined(__cpp_lib_source_location) && \
2227 __cpp_lib_source_location >= 201907L
2228 #define BSLS_LIBRARYFEATURES_HAS_CPP20_SOURCE_LOCATION 1
2229 #endif
2230
2231 #if defined(__cpp_lib_atomic_ref) && \
2232 __cpp_lib_atomic_ref >= 201806L
2233 #define BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_REF 1
2234 #endif
2235
2236 #if defined(__cpp_lib_atomic_lock_free_type_aliases) && \
2237 __cpp_lib_atomic_lock_free_type_aliases >= 201907L
2238 #define BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_LOCK_FREE_TYPE_ALIASES 1
2239 #endif
2240
2241
2242 #if defined(__cpp_lib_atomic_wait) && __cpp_lib_atomic_wait >= 201907L && \
2243 !defined(BSLS_LIBRARYFEATURES_STDCPP_GNU)
2244 #define BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_WAIT_FREE_FUNCTIONS 1
2245 #endif
2246
2247 #if defined(__cpp_lib_atomic_flag_test) && \
2248 __cpp_lib_atomic_flag_test >= 201907L && \
2249 !defined(BSLS_LIBRARYFEATURES_STDCPP_GNU)
2250 #define BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_FLAG_TEST_FREE_FUNCTIONS 1
2251 #endif
2252
2253 #if (defined(__cpp_lib_smart_ptr_for_overwrite) && \
2254 __cpp_lib_smart_ptr_for_overwrite >= 202002L) || \
2255 (defined(BSLS_LIBRARYFEATURES_STDCPP_GNU) && \
2256 (_GLIBCXX_RELEASE == 11 || _GLIBCXX_RELEASE == 12))
2257 // GNU libstdc++ 11 & 12 don't define the macro but define the functions.
2258 #define BSLS_LIBRARYFEATURES_HAS_CPP20_MAKE_UNIQUE_FOR_OVERWRITE 1
2259 #endif
2260
2261 #if defined(__cpp_lib_chrono) && __cpp_lib_chrono >= 201907L
2262 #define BSLS_LIBRARYFEATURES_HAS_CPP20_CALENDAR 1
2263 #endif
2264
2265 // The following macro is not defined as it is not covered by any C++20
2266 // standard feature test macro and the feature it represents not supported by
2267 // any current compilers.
2268 //#define BSLS_LIBRARYFEATURES_HAS_CPP20_CHAR8_MB_CONV
2269
2270 #if defined(__cpp_lib_is_layout_compatible) && \
2271 __cpp_lib_is_layout_compatible >= 201907L
2272 #define BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE 1
2273 #endif
2274
2275 // Per the final sentence of 'P0466R5', the availability of
2276 // 'std::is_corresponding_member' is linked to the availability of
2277 // 'std::is_layout_compatible.
2278 #if defined(__cpp_lib_is_layout_compatible) && \
2279 __cpp_lib_is_layout_compatible >= 201907L
2280 #define BSLS_LIBRARYFEATURES_HAS_CPP20_IS_CORRESPONDING_MEMBER 1
2281 #endif
2282
2283 #if defined(__cpp_lib_is_pointer_interconvertible) && \
2284 __cpp_lib_is_pointer_interconvertible >= 201907L
2285 #define BSLS_LIBRARYFEATURES_HAS_CPP20_IS_POINTER_INTERCONVERTIBLE 1
2286 #endif
2287
2288 #if defined(__cpp_lib_jthread) && __cpp_lib_jthread >= 201911L
2289 #define BSLS_LIBRARYFEATURES_HAS_CPP20_JTHREAD 1
2290 #endif
2291
2292#endif // BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION && _CPP20_BASELINE_LIBRARY
2293
2294// ============================================================================
2295// DEFINE LINK-COERCION SYMBOL
2296// ----------------------------------------------------------------------------
2297
2298// Catch attempts to link C++14 objects with C++17 objects (for example).
2299
2300#if defined(BSLS_LIBRARYFEATURES_HAS_CPP23_BASELINE_LIBRARY)
2301#define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP23_ABI
2302#elif defined(BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY)
2303#define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP20_ABI
2304#elif defined(BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY)
2305#define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP17_ABI
2306#elif defined(BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY)
2307#define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP14_ABI
2308#elif defined(BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY)
2309#define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP11_ABI
2310#else
2311#define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP03_ABI
2312#endif
2313
2314
2315
2318 const char *,
2319 bsls_libraryfeatures_assertion,
2320 BloombergLP::BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME)
2321
2322
2323
2324#endif // INCLUDED_BSLS_LIBRARYFEATURES
2325
2326// ----------------------------------------------------------------------------
2327// Copyright 2017 Bloomberg Finance L.P.
2328//
2329// Licensed under the Apache License, Version 2.0 (the "License");
2330// you may not use this file except in compliance with the License.
2331// You may obtain a copy of the License at
2332//
2333// http://www.apache.org/licenses/LICENSE-2.0
2334//
2335// Unless required by applicable law or agreed to in writing, software
2336// distributed under the License is distributed on an "AS IS" BASIS,
2337// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2338// See the License for the specific language governing permissions and
2339// limitations under the License.
2340// ----------------------------- END-OF-FILE ----------------------------------
2341
2342/** @} */
2343/** @} */
2344/** @} */
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
#define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME
Definition bsls_libraryfeatures.h:2309
#define BSLS_LINKCOERCION_FORCE_SYMBOL_DEPENDENCY(type, refName, referredSymbol)
Definition bsls_linkcoercion.h:194
#define BSLS_PLATFORM_COMPILER_ERROR
Definition bsls_platform.h:289