BDE 4.39.x 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-forcing-language-abi-compatibility"> Forcing Language ABI Compatibility </a>
30/// * <a href="#bsls_libraryfeatures-converse-logic-is-not-symmetric"> Converse Logic Is Not Symmetric </a>
31/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_c90_gets"> BSLS_LIBRARYFEATURES_HAS_C90_GETS </a>
32/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_fp_classify"> BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY </a>
33/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_library"> BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY </a>
34/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_snprintf"> BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF </a>
35/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp98_auto_ptr"> BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR </a>
36/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp98_binders_api"> BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API </a>
37/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_baseline_library"> BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY </a>
38/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_dynamic_exception_specs"> BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS </a>
39/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_exception_handling"> BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING </a>
40/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_garbage_collection_api"> BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API </a>
41/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_miscellaneous_utilities"> BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES </a>
42/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_pair_piecewise_constructor"> BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR </a>
43/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_program_termination"> BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION </a>
44/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_range_functions"> BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS </a>
45/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_short_string"> BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING </a>
46/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_stream_move"> BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE </a>
47/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_tuple"> BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE </a>
48/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_unique_ptr"> BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR </a>
49/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_baseline_library"> BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY </a>
50/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_integer_sequence"> BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE </a>
51/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_range_functions"> BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS </a>
52/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_aligned_alloc"> BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC </a>
53/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_baseline_library"> BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY </a>
54/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_charconv"> BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV </a>
55/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_deprecated_removed"> BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED </a>
56/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_filesystem"> BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM </a>
57/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_int_charconv"> BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV </a>
58/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_parallel_algorithms"> BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS </a>
59/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_pmr"> BSLS_LIBRARYFEATURES_HAS_CPP17_PMR </a>
60/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_pmr_string"> BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING </a>
61/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_precise_bitwidth_atomics"> BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS </a>
62/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_range_functions"> BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS </a>
63/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_search_functors"> BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS </a>
64/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_search_overload"> BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD </a>
65/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_special_math_functions"> BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS </a>
66/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_timespec_get"> BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET </a>
67/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_flag_test_free_functions"> BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_FLAG_TEST_FREE_FUNCTIONS </a>
68/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_lock_free_type_aliases"> BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_LOCK_FREE_TYPE_ALIASES </a>
69/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_ref"> BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_REF </a>
70/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_wait_free_functions"> BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_WAIT_FREE_FUNCTIONS </a>
71/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_baseline_library"> BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY </a>
72/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_calendar"> BSLS_LIBRARYFEATURES_HAS_CPP20_CALENDAR </a>
73/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_char8_mb_conv"> BSLS_LIBRARYFEATURES_HAS_CPP20_CHAR8_MB_CONV </a>
74/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_concepts"> BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS </a>
75/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_deprecated_removed"> BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED </a>
76/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_format"> BSLS_LIBRARYFEATURES_HAS_CPP20_FORMAT </a>
77/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_is_corresponding_member"> BSLS_LIBRARYFEATURES_HAS_CPP20_IS_CORRESPONDING_MEMBER </a>
78/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_is_layout_compatible"> BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE </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_has_cpp20_make_unique_for_overwrite"> BSLS_LIBRARYFEATURES_HAS_CPP20_MAKE_UNIQUE_FOR_OVERWRITE </a>
82/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_ranges"> BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES </a>
83/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_source_location"> BSLS_LIBRARYFEATURES_HAS_CPP20_SOURCE_LOCATION </a>
84/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_syncstream"> BSLS_LIBRARYFEATURES_HAS_CPP20_SYNCSTREAM </a>
85/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_to_array"> BSLS_LIBRARYFEATURES_HAS_CPP20_TO_ARRAY </a>
86/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_timezone"> BSLS_LIBRARYFEATURES_HAS_CPP20_TIMEZONE </a>
87/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_version"> BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION </a>
88/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_allocate_at_least"> BSLS_LIBRARYFEATURES_HAS_CPP23_ALLOCATE_AT_LEAST </a>
89/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_baseline_library"> BSLS_LIBRARYFEATURES_HAS_CPP23_BASELINE_LIBRARY </a>
90/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_bind_back"> BSLS_LIBRARYFEATURES_HAS_CPP23_BIND_BACK </a>
91/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_containers_ranges"> BSLS_LIBRARYFEATURES_HAS_CPP23_CONTAINERS_RANGES </a>
92/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_forward_like"> BSLS_LIBRARYFEATURES_HAS_CPP23_FORWARD_LIKE </a>
93/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_generator"> BSLS_LIBRARYFEATURES_HAS_CPP23_GENERATOR </a>
94/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_int_charconv"> BSLS_LIBRARYFEATURES_HAS_CPP23_INT_CHARCONV </a>
95/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_is_implicit_lifetime"> BSLS_LIBRARYFEATURES_HAS_CPP23_IS_IMPLICIT_LIFETIME </a>
96/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_mdspan"> BSLS_LIBRARYFEATURES_HAS_CPP23_MDSPAN </a>
97/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_out_ptr"> BSLS_LIBRARYFEATURES_HAS_CPP23_OUT_PTR </a>
98/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_print"> BSLS_LIBRARYFEATURES_HAS_CPP23_PRINT </a>
99/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_range_adaptor_closure"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGE_ADAPTOR_CLOSURE </a>
100/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_cartesian_product"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CARTESIAN_PRODUCT </a>
101/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_chunk"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CHUNK </a>
102/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_enumerate"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_ENUMERATE </a>
103/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_range_format"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGE_FORMAT </a>
104/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_as_const"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_AS_CONST </a>
105/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_contains"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CONTAINS </a>
106/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_find_last"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_FIND_LAST </a>
107/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_fold"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_FOLD </a>
108/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_iota"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_IOTA </a>
109/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_join_with"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_JOIN_WITH </a>
110/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_shift"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_SHIFT </a>
111/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_slide"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_SLIDE </a>
112/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_starts_ends_with"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_STARTS_ENDS_WITH </a>
113/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_stride"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_STRIDE </a>
114/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_to_container"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_TO_CONTAINER </a>
115/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_zip"> BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_ZIP </a>
116/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_reference_from_temporary"> BSLS_LIBRARYFEATURES_HAS_CPP23_REFERENCE_FROM_TEMPORARY </a>
117/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_spanstream"> BSLS_LIBRARYFEATURES_HAS_CPP23_SPANSTREAM </a>
118/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_stacktrace"> BSLS_LIBRARYFEATURES_HAS_CPP23_STACKTRACE </a>
119/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_start_lifetime_as"> BSLS_LIBRARYFEATURES_HAS_CPP23_START_LIFETIME_AS </a>
120/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_gnu"> BSLS_LIBRARYFEATURES_STDCPP_GNU </a>
121/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_ibm"> BSLS_LIBRARYFEATURES_STDCPP_IBM </a>
122/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_intellisense"> BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE </a>
123/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_libcstd"> BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD </a>
124/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_llvm"> BSLS_LIBRARYFEATURES_STDCPP_LLVM </a>
125/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_msvc"> BSLS_LIBRARYFEATURES_STDCPP_MSVC </a>
126/// * <a href="#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_stlport"> BSLS_LIBRARYFEATURES_STDCPP_STLPORT </a>
127/// * <a href="#bsls_libraryfeatures-usage"> Usage </a>
128/// * <a href="#bsls_libraryfeatures-example-1-managing-library-dependent-interfaces"> Example 1: Managing Library-Dependent Interfaces </a>
129/// * <a href="#bsls_libraryfeatures-include-tuple"> include <tuple> </a>
130///
131/// # Purpose {#bsls_libraryfeatures-purpose}
132/// Provide macros to identify native standard library features.
133///
134/// # Classes {#bsls_libraryfeatures-classes}
135///
136///
137/// # Macros {#bsls_libraryfeatures-macros}
138///
139/// - BSLS_LIBRARYFEATURES_HAS_C90_GETS: C90 `gets` provided
140/// - BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY: `fpclassify` et al. in `std`
141/// - BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY: C99 library provided
142/// - BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF: C99 `snprintf` provided
143/// - BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR: `auto_ptr` provided
144/// - BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API: adaptable function API provided
145/// - BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY: C++11 base lib provided
146/// - BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS: [deprecated]
147/// - BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING: except handling provided
148/// - BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API: GC support provided
149/// - BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES: misc utils provided
150/// - BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR: use "piecewise"
151/// - BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION: "program exit" provided
152/// - BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS: `begin` and `end` provided
153/// - BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING: revised contract for `string`
154/// - BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE: @ref basic_stream move operations
155/// - BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE: `tuple` provided
156/// - BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR: `unique_ptr` provided
157/// - BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY: C++14 base lib provided
158/// - BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE: @ref integer_sequence defined
159/// - BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS: range functions extension
160/// - BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC: `<cstdlib>`
161/// - BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY: C++17 base lib provided
162/// - BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV: full `<charconv>` support w floats
163/// - BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED: `ptr_fun` et al. gone
164/// - BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM: `<filesystem>`
165/// - BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV: `<charconv>` for integers only
166/// - BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS: `<execution>`
167/// - BSLS_LIBRARYFEATURES_HAS_CPP17_PMR: `<memory_resource>`
168/// - BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING: `pmr::string`
169/// - BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS: optional atomics
170/// - BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS: `data`,`empty`,`size`
171/// - BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS: searcher function objects
172/// - BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD: searcher object overload
173/// - BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS: more `<cmath>`
174/// - BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET: `<ctime>`
175/// - BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_FLAG_TEST_FREE_FUNCTIONS:
176/// - `bsl::atomic_flag_test[_explicit]`
177/// - BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_LOCK_FREE_TYPE_ALIASES:
178/// - `atomic_[un]signed_lock_free`
179/// - BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_REF: `atomic_ref`
180/// - BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_WAIT_FREE_FUNCTIONS:
181/// - `bsl::atomic_flag_wait[_explicit]`
182/// - BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY: C++20 base lib provided
183/// - BSLS_LIBRARYFEATURES_HAS_CPP20_CALENDAR: `<chrono>` calendar/TZ additions
184/// - BSLS_LIBRARYFEATURES_HAS_CPP20_CHAR8_MB_CONV: `mbrtoc8` & `c8rtomb`
185/// - BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS: `<concepts>`
186/// - BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED: `result_of` et al. gone
187/// - BSLS_LIBRARYFEATURES_HAS_CPP20_FORMAT: `<format>`
188/// - BSLS_LIBRARYFEATURES_HAS_CPP20_IS_CORRESPONDING_MEMBER: type trait
189/// - BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE: type trait
190/// - BSLS_LIBRARYFEATURES_HAS_CPP20_IS_POINTER_INTERCONVERTIBLE: type traits
191/// - BSLS_LIBRARYFEATURES_HAS_CPP20_JTHREAD: `std::jthread`
192/// - BSLS_LIBRARYFEATURES_HAS_CPP20_MAKE_UNIQUE_FOR_OVERWRITE: `*_for_overwrite`
193/// - BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES: `<ranges>`
194/// - BSLS_LIBRARYFEATURES_HAS_CPP20_SOURCE_LOCATION: `<source_location>`
195/// - BSLS_LIBRARYFEATURES_HAS_CPP20_SYNCSTREAM: `<syncstream>`
196/// - BSLS_LIBRARYFEATURES_HAS_CPP20_TO_ARRAY: `to_array` factory function
197/// - BSLS_LIBRARYFEATURES_HAS_CPP20_TIMEZONE: `<chrono>` subset of TZ features
198/// - BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION: `<version>`
199/// - BSLS_LIBRARYFEATURES_HAS_CPP23_ALLOCATE_AT_LEAST: C++23 @ref allocate_at_least
200/// - BSLS_LIBRARYFEATURES_HAS_CPP23_BASELINE_LIBRARY: C++23 base lib provided
201/// - BSLS_LIBRARYFEATURES_HAS_CPP23_BIND_BACK: C++23 @ref bind_back
202/// - BSLS_LIBRARYFEATURES_HAS_CPP23_CONTAINERS_RANGES: C++23 @ref from_range
203/// - BSLS_LIBRARYFEATURES_HAS_CPP23_FORWARD_LIKE: C++23 @ref forward_like
204/// - BSLS_LIBRARYFEATURES_HAS_CPP23_GENERATOR: C++23 `generator`
205/// - BSLS_LIBRARYFEATURES_HAS_CPP23_INT_CHARCONV: `constexpr` `<charconv>` ints
206/// - BSLS_LIBRARYFEATURES_HAS_CPP23_IS_IMPLICIT_LIFETIME: `is_implicit_lifetime`
207/// - BSLS_LIBRARYFEATURES_HAS_CPP23_MDSPAN: `<mdspan>`
208/// - BSLS_LIBRARYFEATURES_HAS_CPP23_OUT_PTR: C++23 `out_ptr`, `inout_ptr`
209/// - BSLS_LIBRARYFEATURES_HAS_CPP23_PRINT: C++23 `<print>`
210/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGE_ADAPTOR_CLOSURE:
211/// - C++23 @ref range_adaptor_closure
212/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGE_FORMAT: `std::format` of ranges
213/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_AS_CONST: C++23 const iters & ranges
214/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CARTESIAN_PRODUCT:
215/// - C++23 `views:cartesian_product`
216/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CHUNK: C++23 `views::chunk`
217/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CONTAINS:
218/// - C++23 `ranges::contains` family
219/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_ENUMERATE: C++23 `views::enumerate`
220/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_FIND_LAST:
221/// - C++23 `ranges::find_last` family
222/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_FOLD: C++23 `ranges::fold_*` family
223/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_IOTA: C++23 `ranges::iota`
224/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_JOIN_WITH: C++23 `views::join_with`
225/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_SHIFT: `ranges::shift_{left|right}`
226/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_SLIDE: C++23 `views::slide`
227/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_STARTS_ENDS_WITH:
228/// - C++23 `ranges::{starts|end}_with`
229/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_STRIDE: C++23 `views::stride`
230/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_TO_CONTAINER: C++23 `ranges::to`
231/// - BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_ZIP: C++23 `views::zip` family
232/// - BSLS_LIBRARYFEATURES_HAS_CPP23_REFERENCE_FROM_TEMPORARY:
233/// - C++23 `reference_{constructs|converts}_from_temporary`
234/// - BSLS_LIBRARYFEATURES_HAS_CPP23_SPANSTREAM: C++23 `spanstream` header
235/// - BSLS_LIBRARYFEATURES_HAS_CPP23_STACKTRACE: C++23 `stacktrace`
236/// - BSLS_LIBRARYFEATURES_HAS_CPP23_START_LIFETIME_AS: C++23 @ref start_lifetime_as
237/// - BSLS_LIBRARYFEATURES_STDCPP_GNU: implementation is GNU libstdc++
238/// - BSLS_LIBRARYFEATURES_STDCPP_IBM: implementation is IBM
239/// - BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE: Intellisense is running
240/// - BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD: implementation is Sun's (RogueWave)
241/// - BSLS_LIBRARYFEATURES_STDCPP_LLVM: implementation is LLVM libc++
242/// - BSLS_LIBRARYFEATURES_STDCPP_MSVC: implementation is MSVC
243/// - BSLS_LIBRARYFEATURES_STDCPP_STLPORT: implementation is STLPort
244///
245/// @see bsls_platform, bsls_compilerfeatures
246///
247/// # Description {#bsls_libraryfeatures-description}
248/// This component provides a suite of preprocessor macros that
249/// indicate the availability of library-specific support of features that may
250/// not be available in all standard library versions in use across an
251/// organization. None of these macros will be defined unless the compiler is
252/// building with a tool-chain targeting at least experimental support for a
253/// more recent standard than C++03. For example, the C++11 standard library
254/// introduced several functions and types that were not available in libraries
255/// for earlier standards. The macro
256/// `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` can be used to
257/// conditionally compile BDE code depending on those functions when they are
258/// available, and exclude that code when those functions are not present,
259/// thereby allowing compilation by earlier tool-chains.
260///
261/// The standard library version described by these macros always corresponds to
262/// that used to build this component and is the source of the symbols found in
263/// the `std` namespace.
264///
265/// ## Guarding Against Mixing C++ Versions {#bsls_libraryfeatures-guarding-against-mixing-c-versions}
266///
267///
268/// This component defines a "link-coercion" symbol that prevents linking a
269/// translation unit (that includes this header, possibly indirectly) built
270/// against one version of the C++ Standard with a translation unit (also
271/// including this header) built against another version of the Standard. For
272/// example, attempting to link objects built with C++14 with those built with
273/// C++17 will result in a link-time failure. Because BDE supports a variety of
274/// features that are enabled depending on the C++ version for which code is
275/// built, it is generally not safe to link code built with one version of C++
276/// with code built with another version. For example, in C++11 there are move
277/// constructor signatures, whereas in C++03 there are not, and linking code
278/// that views the set of constructors for a type differently is an ODR
279/// violation. The link-coercion symbol that enforces this is meant to provide
280/// users a single, easy-to-comprehend link-time error, rather than having bugs
281/// potentially manifest at runtime in ways that are difficult to diagnose.
282///
283/// ## Forcing Language ABI Compatibility {#bsls_libraryfeatures-forcing-language-abi-compatibility}
284///
285///
286/// For open-source users, configuration macros are provided to enable ABI
287/// compatibility when compiling BDE between different language standards.
288///
289/// !WARNING! These configuration macros should **NOT** be used outside of
290/// recipes for open-source package managers like VCPKG. Code compiled with
291/// these macros will **NOT** be linkable against code compiled without them
292///
293/// BDE has it's own implementations for a number of types, like
294/// `bsl::string_view`, that when building with a newer language standard
295/// (e.g., C++20) will be an alias to the platform standard library (these are
296/// sometimes referred to as "polyfill" types). By default, BDE will make a
297/// selection between the platform implementation and the BDE implementation
298/// based on the language standard being used. However, that means that
299/// translation units (using BDE) that are compiled with different language
300/// standards are binary incompatible.
301///
302/// BDE provides the following macros for forcing ABI compatibility, to allow
303/// translation units compiled with different language standards to be linked
304/// together. These macros follow a pattern
305/// `BSLS_LIBRARYFEATURES_FORCE_ABI_CPP##`, where `CPP##` is a language standard
306/// (e.g., `CPP11`). Using `*_ABI_CPP11`, for example, forces ABI compatibility
307/// where the minimum supported compiler is C++11, so BDE implementations will
308/// be used for any standard library features that were introduced after C++11.
309///
310/// - `BSLS_LIBRARYFEATURES_FORCE_ABI_CPP11` -
311/// Build the BDE libraries so that they are ABI compatible with a maximum
312/// language standard of C++11.
313///
314/// - `BSLS_LIBRARYFEATURES_FORCE_ABI_CPP17` -
315/// Build the BDE libraries so that they are ABI compatible with a maximum
316/// language standard of C++17.
317///
318/// - `BSLS_LIBRARYFEATURES_FORCE_ABI_CPP20` -
319/// Build the BDE libraries so that they are ABI compatible with a maximum
320/// language standard of C++20.
321///
322/// Attempts to combine these macros, or force ABI compatibility with a language
323/// standard newer than the current compiler will fail. Attempts to link
324/// translation units built with different force-ABI macros defined should fail
325/// (on platforms where @ref bsls_linkcoercion is supported).
326///
327/// Also note that builds with C++03 are always binary incompatible with builds
328/// with other language standards because of the treatment of rvalue-references,
329/// and variadic functions, and variadic templates.
330///
331/// Finally, note that the current list of "polyfill" types BDE provides are:
332///
333/// | Feature | Minimum Language Version For Alias |
334/// | -------------------- |----------------------------------- |
335/// | `span` | C++20 |
336/// | @ref string_view | C++20 [1] |
337/// | `array` | C++17 [1] |
338/// | `optional` | C++17 |
339/// | @ref uncaught_exception | C++17 |
340/// | @ref reference_wrapper | C++11 [2] |
341/// | @ref system_error | C++11 [2] |
342///
343/// 1. BDE uses its own implementations for some of the standard library
344/// features even when a (possibly incomplete) platform implementation is
345/// available to ensure that features are available when building with older
346/// language standards and/or compilers. E.g., we use the BDE
347/// implementation of @ref string_view in C++17 to allow C++17 users to use the
348/// new methods introduced in C++20.
349///
350/// 2. These types are aliases to the matching platform standard library types,
351/// on all platforms where the forced-ABI compatibility macros are relevant.
352///
353/// ## Converse Logic Is Not Symmetric {#bsls_libraryfeatures-converse-logic-is-not-symmetric}
354///
355///
356/// The macros defined by this component describe features empirically observed
357/// in typical platform/compiler/library combinations used in BDE distributions.
358/// The definition of any of these macros implies that a resource is available,
359/// however, the converse is *not* guaranteed. If a macro is not defined, the
360/// associated resource may or may not exist in the library. For example, the
361/// resource may exist but may be of too early an implementation to be of use to
362/// clients of BDE, so in that case the associated macro would *not* be defined.
363///
364/// ## BSLS_LIBRARYFEATURES_HAS_C90_GETS {#bsls_libraryfeatures-bsls_libraryfeatures_has_c90_gets}
365///
366///
367/// The `BSLS_LIBRARYFEATURES_HAS_C90_GETS` macro is defined if the `gets`
368/// function (defined in `<cstdio>`) is provided in namespace `std` by the
369/// native standard library. This dangerous function is removed from the C++14
370/// standard library, and its use with earlier dialects is strongly discouraged.
371///
372/// ## BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY {#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_fp_classify}
373///
374///
375/// The `BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY` macro is defined if *all* of
376/// the listed floating-point classification functions, defined in the headers
377/// named below, are implemented by the native standard library in namespace
378/// `std`:
379///
380/// - Functions defined in `<cmath>`
381/// - `fpclassify`
382/// - `isfinite`
383/// - `isinf`
384/// - `isnan`
385/// - `isnormal`
386/// - `signbit`
387/// - `isgreater`
388/// - `isgreaterequal`
389/// - `isless`
390/// - `islessequal`
391/// - `islessgreater`
392/// - `isunordered`
393///
394/// ## BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_library}
395///
396///
397/// The `BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY` macro is defined if *all* of the
398/// listed functions and types, defined in the headers named below, are
399/// implemented by the native standard library in namespace `std`:
400///
401/// * Functions defined in `<cctype>`
402/// - `isblank`
403/// * Types defined in `<cmath>`
404/// - `double_t`
405/// - `float_t`
406/// * Functions defined in `<cmath>`
407/// - `acosh`
408/// - `asinh`
409/// - `atanh`
410/// - `cbrt`
411/// - `copysign`
412/// - `erf`
413/// - `erfc`
414/// - `exp2`
415/// - `expm1`
416/// - `fdim`
417/// - `fma`
418/// - `fmax`
419/// - `fmin`
420/// - `hypot`
421/// - `ilogb`
422/// - `lgamma`
423/// - `llrint`
424/// - `log1p`
425/// - `log2`
426/// - `logb`
427/// - `lrint`
428/// - `lround`
429/// - `llround`
430/// - `nan`
431/// - `nanl`
432/// - `nanf`
433/// - `nearbyint`
434/// - `nextafter`
435/// - `nexttoward`
436/// - `remainder`
437/// - `remquo`
438/// - `rint`
439/// - `round`
440/// - `scalbln`
441/// - `scalbn`
442/// - `tgamma`
443/// - `trunc`
444/// * Functions defined in `<cstdlib>`
445/// - `atoll`
446/// - `llabs`
447/// - `lldiv`
448/// - `lldiv_t`
449/// - `strtof`
450/// - `strtold`
451/// - `strtoll`
452/// - `strtoull`
453/// * Functions defined in `<cstdio>`
454/// - `vfscanf`
455/// - `vsscanf`
456/// - `vsnprintf`
457/// - `vsscanf`
458/// * Functions defined in `<cwchar>`
459/// - `vfwscanf`
460/// - `vswscanf`
461/// - `vwscanf`
462/// - `wcstof`
463/// - `wcstold`
464/// - `wcstoll`
465/// - `wcstoull`
466/// * Functions defined in `<cwctype>`
467/// - `iswblank`
468///
469/// This macro is defined first for the following compiler versions:
470///
471/// * GCC 4.8
472/// * clang 3.0 using at least GCC 4.8 GNU C++ library
473/// * Microsoft Visual Studio 2015 / MSVC 19.00
474///
475/// Notice that the above list does *not* include `snprintf` as that is included
476/// in the separate `BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF` macro. Also note
477/// that AIX and Solaris compilers generally have implementations of these
478/// functions in the global namespace when including the corresponding C header,
479/// but do not provide the standard C++ mapping.
480///
481/// ## BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF {#bsls_libraryfeatures-bsls_libraryfeatures_has_c99_snprintf}
482///
483///
484/// The `BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF` macro is defined if `snprintf`
485/// function (defined in `<cstdio>`) is implemented by the native standard
486/// library in namespace `std`.
487///
488/// * Function defined in `<cstdio>`
489/// - `snprintf`
490///
491/// This macro is defined first for the following compiler versions:
492///
493/// * GCC 4.8
494/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
495/// * Microsoft Visual Studio 2015 / MSVC 19.00
496///
497/// ## BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp98_auto_ptr}
498///
499///
500/// The `BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR` macro is defined if the
501/// `auto_ptr` class template (defined in `<memory>`) is provided by the native
502/// standard library. This macro is expected to be defined for all
503/// libraries/platforms at least until the introduction of C++17 to our build
504/// systems.
505///
506/// ## BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp98_binders_api}
507///
508///
509/// The `BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API` macro is defined if the
510/// `result_type`, `argument_type`, @ref first_argument_type and
511/// @ref second_argument_type typedefs (defined in `<functional>`) are provided by
512/// the native standard library. This macro is expected to be defined for all
513/// libraries/platforms at least until the introduction of C++20 to our build
514/// systems.
515///
516/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_baseline_library}
517///
518///
519/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is used to
520/// identify whether the current platform's standard library supports a baseline
521/// set of C++11 library features (which are defined below). This is especially
522/// important in BSL when importing standard library functions and types into
523/// the `bsl::` namespace, as is done in `bsl+bslhdrs`. In particular this
524/// macro is used where C++11 has introduced new functions and types into
525/// headers available in older versions of the C++ standard. For example, C++11
526/// introduced the type @ref move_iterator to the existing `<iterator>` header, so
527/// `bsl_iterator.h` uses this macro to determine whether to import
528/// `std::move_iterator` into the `bsl` namespace.
529///
530/// This macro is defined if *both* of the listed conditions are true:
531///
532/// * The compiler supports C++11 language features.
533/// * The following functions and types are provided by the native standard
534/// library:
535/// - Functions defined in `<algorithm>`
536/// - `all_of`
537/// - `any_of`
538/// - `copy_if`
539/// - `copy_n`
540/// - @ref find_if_not
541/// - `is_heap`
542/// - `is_heap_until`
543/// - `is_partitioned`
544/// - `is_permutation`
545/// - `is_sorted`
546/// - `is_sorted_until`
547/// - `minmax`
548/// - @ref minmax_element
549/// - `move`
550/// - @ref move_backward
551/// - `none_of`
552/// - @ref partition_copy
553/// - @ref partition_point
554/// - `shuffle`
555/// - Types defined in `<atomic>`
556/// - atomic class template and specializations for integral types
557/// - Functions defined in `<complex>`
558/// - `acosh`
559/// - `asinh`
560/// - `atanh`
561/// - `proj`
562/// - Functions and types defined in `<exception>`
563/// - @ref current_exception
564/// - `exception_ptr`
565/// - @ref rethrow_exception
566/// - Functions and types defined in `<functional>`
567/// - `bind`
568/// - `bit_and`
569/// - `bit_or`
570/// - `bit_xor`
571/// - `cref`
572/// - `is_bind_expression`
573/// - `is_placeholder`
574/// - `mem_fn`
575/// - `ref`
576/// - @ref reference_wrapper
577/// - Functions defined in `<iomanip>`
578/// - @ref get_money
579/// - @ref put_money
580/// - Functions and types defined in `<ios>`
581/// - `io_errc`
582/// - @ref iostream_category
583/// - `is_error_code_enum`
584/// - @ref make_error_code
585/// - @ref make_error_condition
586/// - `hexfloat`
587/// - `defaultfloat`
588/// - Functions defined in `<iterator>`
589/// - `begin`
590/// - `end`
591/// - @ref move_iterator
592/// - @ref make_move_iterator
593/// - `next`
594/// - `prev`
595/// - Function defined in `<locale>`
596/// - `isblank`
597/// - Functions defined in `<memory>`
598/// - `addressof`
599/// - `allocator_traits`
600/// - @ref pointer_traits
601/// - @ref uninitialized_copy_n
602/// - Function defined in `<numeric>`
603/// - `iota`
604/// - Member function defined in `<typeinfo>`
605/// - `type_info::hash_code`
606/// - Functions defined in `<utility>`
607/// - `declval`
608/// - `forward`
609/// - `move`
610/// - @ref move_if_noexcept
611/// - `swap`
612/// * The following headers can be included:
613/// - `<array>`
614/// - `<atomic>`
615/// - `<cfenv>`
616/// - `<chrono>`
617/// - `<cinttypes>`
618/// - `<codecvt>`
619/// - `<condition_variable>`
620/// - `<cstdint>`
621/// - `<cuchar>`
622/// - `<forward_list>`
623/// - `<future>`
624/// - `<mutex>`
625/// - `<random>`
626/// - `<ratio>`
627/// - `<regex>`
628/// - `<scoped_allocator>`
629/// - `<system_error>`
630/// - `<thread>`
631/// - `<typeindex>`
632/// - `<unordered_map>`
633/// - `<unordered_set>`
634///
635/// This macro is defined first for the following compiler versions:
636///
637/// * GCC 4.8
638/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
639/// * Microsoft Visual Studio 2015 / MSVC 19.00
640///
641/// Notice that the above list does *not* include @ref random_shuffle as that is
642/// deprecated in C++14 and will be removed in C++17.
643///
644/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_dynamic_exception_specs}
645///
646///
647/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS` macro is
648/// defined if *both* of the listed conditions are true:
649///
650/// * The compiler support is less or equal to C++20.
651/// * The following functions and types are provided by the native standard
652/// library in `<exception>`:
653/// - `unexpected`
654/// - @ref unexpected_handler
655/// - @ref set_unexpected
656/// - @ref get_unexpected
657///
658/// **DEPRECATED**: Do not use the API listed above.
659///
660/// This macro is defined first for the following compiler versions:
661///
662/// * GCC 5.0
663/// * clang 3.0 using at least GCC 5.0 GNU C++ Library
664/// * Microsoft Visual Studio 2015 / MSVC 19.00
665///
666/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_exception_handling}
667///
668///
669/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING` macro is defined if
670/// *both* of the listed conditions are true:
671///
672/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
673/// * The following functions and types are provided by the native standard
674/// library in `<exception>`:
675/// - `exception_ptr`
676/// - @ref make_exception_ptr
677/// - @ref nested_exception
678/// - @ref rethrow_if_nested
679/// - @ref throw_with_nested
680///
681/// This macro is defined first for the following compiler versions:
682///
683/// * GCC 4.8
684/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
685/// * Microsoft Visual Studio 2015 / MSVC 19.00
686///
687/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_garbage_collection_api}
688///
689///
690/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API` macro is defined
691/// if *both* of the listed conditions are true:
692///
693/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
694/// * The following functions and types are provided by the native standard
695/// library in `<memory>`:
696/// - @ref declare_no_pointers
697/// - @ref declare_reachable
698/// - @ref get_pointer_safety
699/// - @ref pointer_safety
700/// - @ref undeclare_no_pointers
701/// - @ref undeclare_reachable
702///
703/// This macro is defined first for the following compiler versions:
704///
705/// * GCC 6.0
706/// * clang 3.0 using at least GCC 6.0 GNU C++ Library
707/// * Microsoft Visual Studio 2015 / MSVC 19.00
708///
709/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_miscellaneous_utilities}
710///
711///
712/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES` macro is
713/// defined if *both* of the listed conditions are true:
714///
715/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
716/// * The following functions and types are provided by the native standard
717/// library:
718/// - Type defined in `<cstddef>`
719/// - @ref max_align_t
720/// - Functions defined in `<exception>`
721/// - @ref get_terminate
722/// - Functions defined in `<iomanip>`
723/// - @ref get_time
724/// - @ref put_time
725/// - Functions defined in `<locale>`
726/// - `isblank`
727/// - @ref wstring_convert
728/// - @ref wbuffer_convert
729/// - Function defined in `<memory>`
730/// - `align`
731/// - Class and function defined in `<new>`
732/// - @ref bad_array_new_length
733/// - @ref get_new_handler
734///
735/// This macro is defined first for the following compiler versions:
736///
737/// * GCC 5.0
738/// * clang 3.0 using at least GCC 5.0 GNU C++ Library
739/// * Microsoft Visual Studio 2015 / MSVC 19.00
740///
741/// Notice that the function @ref get_unexpected will be removed in C++17.
742///
743/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_pair_piecewise_constructor}
744///
745///
746/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR` macro is
747/// defined if the `pair` class template (defined in `<utility>`) provided by
748/// the native library has a constructor with the signature:
749/// @code
750/// template <class... Args1, class... Args2>
751/// pair(piecewise_construct_t ,
752/// tuple<Args1...> first_args,
753/// tuple<Args2...> second_args);
754/// @endcode
755/// Notice that the existence of the above constructor implies that each of the
756/// following conditions are also true:
757///
758/// * The @ref piecewise_construct_t (tag) type (defined in `<utility>`) is
759/// provided by the native standard library.
760/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
761/// * The `BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES` macro is defined.
762/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE` macro is defined.
763///
764/// This macro is defined first for the following compiler versions:
765///
766/// * GCC 4.8
767/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
768/// * Microsoft Visual Studio 2015 / MSVC 19.00
769///
770/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_program_termination}
771///
772///
773/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION` macro is defined if
774/// of the listed conditions are true:
775///
776/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
777/// * The following functions are provided by the native standard library in
778/// the `<cstdlib>` header:
779/// * `_Exit`
780/// * @ref quick_exit
781/// * `at_quick_exit`
782///
783/// This macro is defined first for the following compiler versions:
784///
785/// * GCC 4.8
786/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
787/// * Microsoft Visual Studio 2015 / MSVC 19.00
788///
789/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_range_functions}
790///
791///
792/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS` macro is defined if
793/// the following functions are provided by the native standard library in the
794/// `<iterator>` header:
795///
796/// @code
797/// template <class C> auto begin(C& c) -> decltype(c.begin());
798/// template <class C> auto begin(const C& c) -> decltype(c.begin());
799/// template <class C> auto end(C& c) -> decltype(c.end());
800/// template <class C> auto end(const C& c) -> decltype(c.end());
801/// template <class T, size_t N> T* begin(T (&array)[N]);
802/// template <class T, size_t N> T* end(T (&array)[N]);
803/// @endcode
804///
805/// This macro is defined first for the following compiler versions:
806///
807/// * GCC 4.6
808/// * clang 3.0
809/// * Microsoft Visual Studio 2012 / MSVC 17.00
810///
811/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_short_string}
812///
813///
814/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING` macro is defined if the
815/// standard library class template `std::basic_string` follows the revised
816/// contract of C++11 that essentially bans the copy-on-write optimization in
817/// favor of using the short string optimization. This ABI-breaking change was
818/// necessary for an efficient implementation under the C++11 memory model.
819/// Note that this feature macro is constrained not just by library version, but
820/// also by a library compatibility switch on some platforms. For example, Red
821/// Hat Enterprise Linux 7 and earlier enforce the use of the older C++98 string
822/// with the copy-on-write optimization.
823///
824/// * Supported by the compiler vendor's STL implementation
825/// - GCC 4.8 (depending on ABI configuration)
826/// - clang 3.3 (see GCC above if configured for Gnu standard library)
827/// - Microsoft Visual Studio 2015 / MSVC 19.00
828///
829/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_stream_move}
830///
831///
832/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE` macro is defined if the
833/// standard stream classes (@ref basic_istream , @ref basic_ostream , @ref basic_stream )
834/// all have the C++11 mandated move operations (constructor and assignment
835/// operator) defined. Notice that the this macro is separate from the macro
836/// `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` as standard library
837/// implementations exist that implement almost all of C++11 (which is detected
838/// by the `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro) but not this
839/// feature. Note that when `BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE` is
840/// defined `BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES` will also be
841/// defined, as the standard feature cannot be implemented without rvalue
842/// reference support from the compiler.
843///
844/// * Supported by the compiler vendor's STL implementation
845/// - GCC 5.0
846/// - clang 3.0
847/// - Microsoft Visual Studio 2015 / MSVC 19.00
848///
849/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_tuple}
850///
851///
852/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE` macro is defined if *both* of the
853/// listed conditions are true:
854///
855/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
856/// * The `tuple` type template (defined in `<tuple>`) is provided by the
857/// native standard library.
858/// * The `BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES` macro is also
859/// defined.
860///
861/// This macro is defined first for the following compiler versions:
862///
863/// * GCC 4.8
864/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
865/// * Microsoft Visual Studio 2015 / MSVC 19.00
866///
867/// ## BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp11_unique_ptr}
868///
869///
870/// The `BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR` macro is defined if *both*
871/// of the listed conditions are true:
872///
873/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
874/// * The `unique_ptr` class template (defined in `<memory>`) is provided by
875/// the native standard library.
876/// * The `BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES` macro is also
877/// defined.
878///
879/// This macro is defined first for the following compiler versions:
880///
881/// * GCC 4.8
882/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
883/// * Microsoft Visual Studio 2015 / MSVC 19.00
884///
885/// ## BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_baseline_library}
886///
887///
888/// The `BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY` macro is used to
889/// identify whether the current platform's standard library supports a baseline
890/// set of C++14 library features (which are defined below). This is especially
891/// important in BSL when importing standard library functions and types into
892/// the `bsl::` namespace, as is done in `bsl+bslhdrs`.
893///
894/// This macro is defined if *all* of the listed conditions are true:
895///
896/// * The compiler supports C++14 language features.
897/// * The following functions and types are provided by the native standard
898/// library:
899/// - UDLs support for `<chrono>`
900/// - UDLs support for `<complex>`
901/// - Type defined in `<functional>`
902/// - `bit_not`
903/// - Function defined in `<iterator>`
904/// - @ref make_reverse_iterator
905/// - Function defined in `<iomanip>`
906/// - `quoted`
907/// - Function defined in `<memory>`
908/// - @ref make_unique
909/// - Function defined in `<type_traits>`
910/// - `is_null_pointer`
911/// - `is_final`
912/// - Function defined in `<utility>`
913/// - `exchange`
914/// * The header `<shared_mutex>` is available providing the standard
915/// components.
916///
917/// This macro is defined first for the following compiler versions:
918///
919/// * GCC 4.9
920/// * clang 3.4
921/// * Microsoft Visual Studio 2015 / MSVC 19.00
922///
923/// ## BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_integer_sequence}
924///
925///
926/// The `BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE` macro is defined if
927/// *all* of the listed conditions are true:
928///
929/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
930/// * The `BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES` macro is defined.
931/// * The `BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES` macro is defined.
932///
933/// The BDE feature macro `BSLS_COMPILERFEATURES_FULL_CPP11` is also defined
934/// in the case that all of these conditions are met, and is often simpler to
935/// test for.
936///
937/// Note that though `struct` @ref integer_sequence was introduced in the C++14
938/// standard, `bsl::integer_sequence` is supported by BDE when compiling in
939/// C++11 mode.
940///
941/// This macro is defined first for the following compiler versions:
942///
943/// * GCC 4.8
944/// * clang 3.0 using at least GCC 4.8 GNU C++ Library
945/// * Microsoft Visual Studio 2015 / MSVC 19.00
946///
947/// ## BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp14_range_functions}
948///
949///
950/// The `BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS` macro is defined if the
951/// following functions are provided by the native standard library in the
952/// `<iterator>` header:
953///
954/// @code
955/// template <class C> auto cbegin(const C& c) -> decltype(std::begin(c));
956/// template <class C> auto cend( const C& c) -> decltype(std::end(c));
957///
958/// template <class C> auto rbegin( C& c) -> decltype(c.rbegin());
959/// template <class C> auto rbegin(const C& c) -> decltype(c.rbegin());
960///
961/// template <class C> auto rend( C& c) -> decltype(c.rend());
962/// template <class C> auto rend(const C& c) -> decltype(c.rend());
963///
964/// template <class T, size_t N> reverse_iterator<T*> rbegin(T (&array)[N]);
965/// template <class T, size_t N> reverse_iterator<T*> rend( T (&array)[N]);
966///
967/// template <class E> reverse_iterator<const E*> rbegin(initializer_list<E>);
968/// template <class E> reverse_iterator<const E*> rend( initializer_list<E>);
969///
970/// template <class C> auto crbegin(const C& c) -> decltype(std::rbegin(c));
971/// template <class C> auto crend( const C& c) -> decltype(std::rend(c));
972/// @endcode
973///
974/// This macro is defined first for the following compiler versions:
975///
976/// * GCC 4.9
977/// * clang 3.4
978/// * Microsoft Visual Studio 2015 / MSVC 19.00
979///
980/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_aligned_alloc}
981///
982///
983/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC` macro is defined if the
984/// native standard library provides `std::aligned_alloc`.
985///
986/// Both libstdc++ and libc++ will provide this call if the underlying C library
987/// provides the global call `::aligned_alloc`. This call is available on
988/// RedHat version 7, for example, but not on RedHat 6. Microsoft does not
989/// provide this call. See https://github.com/microsoft/STL/issues/2176
990///
991/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_baseline_library}
992///
993///
994/// This macro is used to identify whether the current platform's standard
995/// library supports a baseline set of C++17 library features (which are defined
996/// below). This is especially important in BSL when importing standard library
997/// functions and types into the `bsl::` namespace, as is done in `bsl+bslhdrs`.
998///
999/// This macro is defined if all of the listed conditions are true:
1000///
1001/// * The compiler supports C++17 language features.
1002/// * The following headers can be included:
1003/// - `<any>`
1004/// - `<optional>`
1005/// - `<variant>`
1006/// - `<string_view>`
1007///
1008/// This macro is defined first for the following compiler versions:
1009///
1010/// * GCC 7
1011/// * clang 7
1012/// * Microsoft Visual Studio 2019 / MSVC 19.20
1013///
1014/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_charconv}
1015///
1016///
1017/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV` macro is defined if the native
1018/// standard library provides the `<charconv>` header and implements all
1019/// required content with no major issues. This macro is defined in addition to
1020/// the `BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV` macro when the native
1021/// standard library also implements the `std::chars_format` enumeration, and
1022/// both `std::from_chars` and `std::to_chars` functions for all 3 standard
1023/// floating point types (`float`, `double`, `long double`).
1024///
1025/// This macro is defined first for the following compiler versions:
1026///
1027/// - GCC 12
1028/// - clang using at least GCC 12 GNU C++ Library
1029/// - Microsoft Visual Studio 2019 / MSVC 19.20
1030///
1031/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_deprecated_removed}
1032///
1033///
1034/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED` macro is defined for
1035/// libraries that do not export names removed in C++17, such as `std::ptr_fun`.
1036/// `BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED` is generally the
1037/// negation of `BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR`. Although the removal
1038/// of deprecated C++17 types is conceptually equivalent to
1039/// `__cplusplus >= 201703L`, standard library implementations often provide
1040/// configuration flags to expose the deprecated library features.
1041///
1042/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_filesystem}
1043///
1044///
1045/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM` macro is defined if the
1046/// native standard library provides the `<filesystem>` header and implements
1047/// all required content with no major issues.
1048///
1049/// This macro is defined first for the following compiler versions:
1050///
1051/// - GCC 9
1052/// - clang 14, or clang using at least GCC 9 GNU C++ Library
1053/// - Microsoft Visual Studio 2017 15.7 / MSVC 19.14
1054///
1055/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_int_charconv}
1056///
1057///
1058/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV` macro is defined if the
1059/// native standard library provides the `<charconv>` header and implements both
1060/// `std::from_chars` and `std::to_chars` for all standard signed and unsigned
1061/// integer types and the `char` type, as well as the `std::to_chars_result` and
1062/// `std::from_chars_result` types.
1063///
1064/// This macro is defined first for the following compiler versions:
1065///
1066/// - GCC 8
1067/// - clang using at least GCC 8 GNU C++ Library
1068/// - Microsoft Visual Studio 2017 / MSVC 19.10
1069///
1070/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_parallel_algorithms}
1071///
1072///
1073/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS` macro is defined if
1074/// the native standard library provides the `<execution>` header and implements
1075/// all the parallel algorithm overloads in the `<algorithm>` and <`numeric>`
1076/// headers with no major issues.
1077///
1078/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_PMR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_pmr}
1079///
1080///
1081/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_PMR` macro is defined if the
1082/// native standard library provides the `<memory_resource>` header and
1083/// implements all required content with no major issues.
1084///
1085/// This macro is defined first for the following stdlib versions:
1086///
1087/// - GNU libstdc++ v 9
1088/// - LLVM libc++ v 16
1089/// - MSVC++ STL v 15.6 (VS 2017)
1090///
1091/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_pmr_string}
1092///
1093///
1094/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING` macro is defined if the
1095/// native standard library provides the `pmr::basic_string` class template with
1096/// no major issues.
1097///
1098/// Usually `pmr::string` is available if the PMR feature is available. But GNU
1099/// libstdc++ does not provide it for the obsolete pre-C++11 CoW string
1100/// implemetation (`_GLIBCXX_USE_CXX11_ABI` == 0).
1101///
1102/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_precise_bitwidth_atomics}
1103///
1104///
1105/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS` macro is
1106/// defined if *both* of the listed conditions are true: defined if the
1107/// `<atomic>` header provided by the native standard library provides type
1108/// aliases for all of the following precise bit-width atomic types:
1109///
1110/// * The `BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY` macro is defined.
1111/// * The following type aliases are provided by the native standard library in
1112/// the `<atomic>` header:
1113/// - @ref atomic_int8_t
1114/// - @ref atomic_int16_t
1115/// - @ref atomic_int32_t
1116/// - @ref atomic_int64_t
1117/// - @ref atomic_uint8_t
1118/// - @ref atomic_uint16_t
1119/// - @ref atomic_uint32_t
1120/// - @ref atomic_uint64_t
1121/// - @ref atomic_intptr_t
1122/// - @ref atomic_uintptr_t
1123///
1124/// This macro is defined first for the following compiler versions:
1125///
1126/// * GCC 7.0
1127/// * clang 3.0 using at least GCC 7.0 GNU C++ Library
1128/// * Microsoft Visual Studio 2015 / MSVC 19.00
1129///
1130/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_range_functions}
1131///
1132///
1133/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS` macro is defined if the
1134/// following functions are provided by the native standard library in the
1135/// `<iterator>` header:
1136///
1137/// @code
1138/// template <class C> auto empty(const C& c) -> decltype(c.empty());
1139/// template <class C> auto data( const C& c) -> decltype(c.data());
1140/// template <class C> auto size( const C& c) -> decltype(c.size());
1141/// @endcode
1142///
1143/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_search_functors}
1144///
1145///
1146/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS` macro is defined if the
1147/// native library supplies the following class templates in `<functional>`:
1148///
1149/// * @ref default_searcher
1150/// * @ref boyer_moore_searcher
1151/// * @ref boyer_moore_horspool_searcher
1152///
1153/// Currently the following compilers define this function template in C++17 or
1154/// later modes:
1155///
1156/// * GCC 8.3.0
1157/// * Microsoft Visual Studio 2019 / MSVC 19.20
1158/// * clang 3.0 with GNU library
1159///
1160/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_search_overload}
1161///
1162///
1163/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD` macro is defined if
1164/// `<algorithm>` defines an overload for the `search` function template that
1165/// accepts instances of the searcher classes introduced in C++17. See
1166/// [alg.search]:
1167/// @code
1168/// template<class ForwardIterator, class Searcher>
1169/// constexpr ForwardIterator std::search(ForwardIterator first,
1170/// ForwardIterator last,
1171/// const Searcher& searcher);
1172/// @endcode
1173///
1174/// Currently the following compilers define this function template in C++17 or
1175/// later modes:
1176///
1177/// * GCC 8.3.0
1178/// * Microsoft Visual Studio 2017 / MSVC 19.10
1179/// * clang above 3.0 with GNU library
1180/// * Apple clang all supported versions
1181///
1182/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_special_math_functions}
1183///
1184///
1185/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS` macro is defined
1186/// if the special math functions such as `std::assoc_laguerre`, `std::beta` and
1187/// others are provided by the native standard library in the `<cmath>` header.
1188///
1189/// ## BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp17_timespec_get}
1190///
1191///
1192/// The `BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET` macro is defined if the
1193/// native standard library provides `std::timespec_get`.
1194///
1195/// Both libstdc++ and libc++ will provide this call if the underlying C library
1196/// provides the global call `::timespec_get`. This call is available on RedHat
1197/// version 7, for example, but not on RedHat 6.
1198///
1199/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_FLAG_TEST_FREE_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_flag_test_free_functions}
1200///
1201///
1202/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_FLAG_TEST_FREE_FUNCTIONS` is
1203/// defined if the `bsl::atomic_flag_test` and `bsl::atomic_flag_test_explicit`
1204/// functions are available with C++20 semantics.
1205///
1206/// This macro is defined if the standard `__cpp_lib_atomic_flag_test`
1207/// feature-test macro is defined and has a value of at least 201907L.
1208///
1209/// This macro is defined first for the following compiler versions:
1210///
1211/// - clang 15 when compiling against libc++ version 15, or
1212/// - Microsoft Visual Studio 2022 / MSVC 19.30
1213///
1214/// (no current version of GCC supports this feature)
1215///
1216/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_LOCK_FREE_TYPE_ALIASES {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_lock_free_type_aliases}
1217///
1218///
1219/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_LOCK_FREE_TYPE_ALIASES` macro is
1220/// defined if `bsl::atomic_signed_lock_free` and
1221/// `bsl:atomic_unsigned_lock_free` types are available with C++20 semantics.
1222///
1223/// This macro is defined if the standard
1224/// `__cpp_lib_atomic_lock_free_type_aliases` feature-test macro is defined.
1225///
1226/// This macro is defined first for the following compiler versions:
1227///
1228/// - GCC 13.1
1229/// - Microsoft Visual Studio 2022 / MSVC 19.30
1230///
1231/// (no curent version of clang supports this feature)
1232///
1233/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_REF {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_ref}
1234///
1235///
1236/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_REF` macro is defined if the
1237/// `bsl::atomic_ref` type is available with C++20 semantics.
1238///
1239/// This macro is defined if the standard `__cpp_lib_atomic_ref`
1240/// feature-test macro is defined and `__cpp_lib_atomic_ref >= 201806L`.
1241///
1242/// This macro is defined first for the following compiler versions:
1243///
1244/// - GCC 11.1
1245/// - clang 15 when compiling against libstdc++ version 11
1246/// - Microsoft Visual Studio 2022 / MSVC 19.30
1247///
1248/// (no current version of libc++ supports this feature)
1249///
1250/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_WAIT_FREE_FUNCTIONS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_atomic_wait_free_functions}
1251///
1252///
1253/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_WAIT_FREE_FUNCTIONS` macro is
1254/// defined if the following free functions are available:
1255/// `bsl::atomic_flag_wait`, `bsl::atomic_flag_wait_explicit`,
1256/// `bsl::atomic_flag_notify_one`, `bsl::atomic_flag_notify_all` with C++20
1257/// semantics.
1258///
1259/// This macro is defined if the standard `__cpp_lib_atomic_wait` feature-test
1260/// macro is defined and has a value of at least 201907L.
1261///
1262/// This macro is defined first for the following compiler versions:
1263///
1264/// - clang 15 when compiling against libc++ version 15, or
1265/// - Microsoft Visual Studio 2022 / MSVC 19.30
1266///
1267/// (no current version of GCC supports this feature)
1268///
1269/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_baseline_library}
1270///
1271///
1272/// This macro is used to identify whether the current platform's standard
1273/// library supports a baseline set of C++20 library features (which are defined
1274/// below). This is especially important in BSL when importing standard library
1275/// functions and types into the `bsl::` namespace, as is done in `bsl+bslhdrs`.
1276///
1277/// This macro is defined if all of the listed conditions are true:
1278///
1279/// * The compiler supports C++20 language features.
1280/// * The following headers can be included:
1281/// - `<barrier>`
1282/// - `<bit>`
1283/// - `<latch>`
1284/// - `<numbers>`
1285/// - `<semaphore>`
1286/// - `<span>`
1287/// - `<stop_token>`
1288/// * The `<type_traits>` header defines:
1289/// - `std::remove_cvref`
1290/// - `std::type_identify`
1291///
1292/// This macro is defined first for the following compiler versions:
1293///
1294/// - GCC 11.1
1295/// - clang 15 when compiling against either:
1296/// - libc++ version 15, or
1297/// - libstdc++ version 11
1298/// - Microsoft Visual Studio 2022 / MSVC 19.30
1299///
1300/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_CALENDAR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_calendar}
1301///
1302///
1303/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_CALENDAR` macro is defined if the C++20
1304/// calendar/TZ features, except those guarded by the
1305/// `BSLS_LIBRARYFEATURES_HAS_CPP20_TIMEZONE` macro, are available in
1306/// `bsl::chrono` namespace.
1307///
1308/// This macro is defined if the standard `__cpp_lib_chrono` feature-test macro
1309/// has at least `201907L` value.
1310///
1311/// This feature has been provided by MSVC++ compiler since VS 2019 16.10. But
1312/// that release was shipped with the following important note: "While the STL
1313/// generally provides all features on all supported versions of Windows, leap
1314/// seconds and time zones (which change over time) require OS support that was
1315/// added to Windows 10. Specifically, updating the leap second database
1316/// requires Windows 10 version 1809 or later, and time zones require `icu.dll`
1317/// which is provided by Windows 10 version 1903/19H1 or later. This applies to
1318/// both client and server OSes; note that Windows Server 2019 is based on
1319/// Windows 10 version 1809." If the feature is used on a host that does not
1320/// provide `icu.dll`, an exception with "The specified module could not be
1321/// found." message will be thrown. For this reason those features are disabled
1322/// by default on Windows.
1323///
1324/// This macro is defined first for the following compiler versions:
1325///
1326/// - Microsoft Visual Studio 2022 / MSVC 19.30
1327/// - GCC 14+
1328///
1329/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_CHAR8_MB_CONV {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_char8_mb_conv}
1330///
1331///
1332/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_CHAR8_MB_CONV` macro is defined if the
1333/// `bsl::mbrtoc8` and `bsl::c8rtomb` functions are available with C++20
1334/// semantics.
1335///
1336/// (no current version of GCC, clang or MSVC supports this feature)
1337///
1338/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_concepts}
1339///
1340///
1341/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS` macro is defined if the native
1342/// standard library provides the `<concepts>` header and implements all
1343/// required content with no major issues.
1344///
1345/// This macro is defined if the standard `__cpp_lib_concepts` feature-test
1346/// macro is defined and `__cpp_lib_concepts >= 202002L`.
1347///
1348/// This macro is defined first for the following compiler versions:
1349///
1350/// - GCC 11.1
1351/// - clang 15 when compiling against either:
1352/// - libc++ version 15, or
1353/// - libstdc++ version 11
1354/// - Microsoft Visual Studio 2022 17.2 / MSVC 19.32
1355///
1356/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_deprecated_removed}
1357///
1358///
1359/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED` macro is defined for
1360/// libraries that do not export names removed in C++20, such as
1361/// `std::uncaught_exception`. Although the removal of deprecated C++20 types
1362/// is conceptually equivalent to `__cplusplus >= 202002L`, some standard
1363/// library implementations may continue to expose the features, and some may
1364/// provide configuration flags to expose the deprecated library features.
1365///
1366/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_FORMAT {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_format}
1367///
1368///
1369/// `BSLS_LIBRARYFEATURES_HAS_CPP20_FORMAT` macro is defined if the `<format>`
1370/// header is available and supports P2216 and P2372 (which were defect reports
1371/// against C++20).
1372///
1373/// This macro is defined first for the following compiler versions:
1374/// - GCC 13.1
1375/// - Clang 17.0 with either:
1376/// - libc++ 21.1.0, or
1377/// - libstdc++ 13.1
1378/// - VS 16.11 / MSVC 19.29
1379///
1380/// (*) Up to libc++ 20.10 there is a bug with character arrays
1381/// https://github.com/llvm/llvm-project/issues/115935
1382///
1383/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_IS_CORRESPONDING_MEMBER {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_is_corresponding_member}
1384///
1385///
1386/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_IS_CORRESPONDING_MEMBER` macro is
1387/// defined if the `bsl::is_corresponding_member` meta function is available.
1388///
1389/// Note that the standard feature test macro `__cpp_lib_is_layout_compatible`,
1390/// the macro that informs
1391/// `BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE`, is also defined. See
1392/// the last sentence of `P0466R5`.
1393///
1394/// This macro is defined first for the following compiler versions:
1395///
1396/// - GCC 12.1
1397/// - Microsoft Visual Studio 2022 / MSVC 19.30
1398///
1399/// (no current version of clang supports this feature)
1400///
1401/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_is_layout_compatible}
1402///
1403///
1404/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE` macro is defined
1405/// if the `bsl::is_layout_compatible` meta function is available.
1406///
1407/// Note that the standard feature test macro `__cpp_lib_is_layout_compatible`
1408/// is also defined and has a value of at least `201907L`.
1409///
1410/// This macro is defined first for the following compiler versions:
1411///
1412/// - GCC 12.1
1413/// - Microsoft Visual Studio 2022 / MSVC 19.30
1414///
1415/// (no current version of clang supports this feature)
1416///
1417/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_IS_POINTER_INTERCONVERTIBLE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_is_pointer_interconvertible}
1418///
1419///
1420/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_IS_POINTER_INTERCONVERTIBLE` macro is
1421/// defined if the `bsl::is_pointer_interconvertible_base_of` and
1422/// `bsl::is_pointer_interconvertible_with_class` meta functions are available.
1423///
1424/// Note that the standard feature test macro
1425/// `__cpp_lib_is_pointer_interconvertible` is also defined and has a value of
1426/// at least `201907L`.
1427///
1428/// This macro is defined first for the following compiler versions:
1429///
1430/// - GCC 12.1
1431/// - Microsoft Visual Studio 2022 / MSVC 19.30
1432///
1433/// (no current version of clang supports this feature)
1434///
1435/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_JTHREAD {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_jthread}
1436///
1437///
1438/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_JTHREAD` macro is defined if the C++20
1439/// `bsl::jthread` class in the `<bsl_thread.h>` header available.
1440///
1441/// Note that the standard feature test macro `__cpp_lib_jthread` is also
1442/// defined and has a value of at least `201911L`.
1443///
1444/// This macro is defined first for the following compiler versions:
1445///
1446/// - GCC 10.1
1447/// - Microsoft Visual Studio 2019 Update 9 / _MSC_FULL_VER 192829913
1448/// - clang 18.0 with -fexperimental-library
1449///
1450/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_MAKE_UNIQUE_FOR_OVERWRITE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_make_unique_for_overwrite}
1451///
1452///
1453/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_MAKE_UNIQUE_FOR_OVERWRITE` macro is
1454/// defined if the `bsl::make_unique_for_overwrite` function is available with
1455/// C++20 semantics.
1456///
1457/// This macro is defined first for the following compiler versions:
1458///
1459/// - GCC 11.1
1460/// - clang 15 when compiling against either:
1461/// - libc++ version 15, or
1462/// - libstdc++ version 11
1463/// - Microsoft Visual Studio 2022 / MSVC 19.30
1464///
1465/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_ranges}
1466///
1467///
1468/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES` macro is defined if the native
1469/// standard library provides the `<ranges>` header and implements all required
1470/// C++20 content with no major issues.
1471///
1472/// This macro is defined if the standard `__cpp_lib_ranges` feature-test macro
1473/// is defined and `__cpp_lib_ranges >= 202110L`.
1474///
1475/// This macro is defined first for the following compiler versions:
1476///
1477/// - GCC 12.1
1478/// - clang 15 when compiling against libc++ version 15
1479/// - clang 16 when compiling against
1480/// - libc++ version 16, or
1481/// - libstdc++ version 12
1482/// - Microsoft Visual Studio 2022 17.2 / MSVC 19.32
1483///
1484/// Note that GCC 11 ranges support is incomplete, as it is missing a number of
1485/// key Defect Report fixes, notably P2259R1, P2210R2, P2432R1, and P2415R2,
1486/// the latter being a breaking change between GCC 11 and GCC 12.
1487///
1488/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_SOURCE_LOCATION {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_source_location}
1489///
1490///
1491/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_SOURCE_LOCATION` macro is defined if the
1492/// native standard library provides the `<source_location>` header and
1493/// implements all required C++20 content with no major issues.
1494///
1495/// This macro is defined if the standard `__cpp_lib_source_location`
1496/// feature-test macro is defined and `__cpp_lib_source_location >= 201907L`.
1497///
1498/// This macro is defined first for the following compiler versions:
1499///
1500/// - GCC 11.1
1501/// - clang 15 when compiling against either:
1502/// - libc++ version 16, or
1503/// - libstdc++ version 11
1504/// - Microsoft Visual Studio 2022 / MSVC 19.30
1505///
1506/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_SYNCSTREAM {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_syncstream}
1507///
1508///
1509/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_SYNCSTREAM` macro is defined if the
1510/// native standard library provides the `<syncstream>` header and implements
1511/// all required content with no major issues.
1512///
1513/// This macro is defined if the standard `__cpp_lib_syncbuf` feature-test macro
1514/// is defined and `__cpp_lib_syncbuf >= 201803L`.
1515///
1516/// This macro is defined first for the following compiler versions:
1517///
1518/// - GCC 11
1519/// - LLVM libc++ 18
1520/// - Microsoft Visual Studio 2019 16.10 / MSVC 19.29
1521///
1522/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_TO_ARRAY {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_to_array}
1523///
1524///
1525/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_TO_ARRAY` macro is defined if the native
1526/// standard library implements the `to_array` factory function in the `<array>`
1527/// header correctly with no major issues.
1528///
1529/// This macro is defined if the standard `__cpp_lib_to_array` feature-test
1530/// macro is defined and `__cpp_lib_to_array >= 201907L`.
1531///
1532/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_TIMEZONE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_timezone}
1533///
1534///
1535/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_TIMEZONE` macro is defined if the
1536/// following C++20 timezone features are available in `bsl::chrono` namespace:
1537///
1538/// - tzdb
1539/// - tzdb_list
1540/// - get_tzdb
1541/// - get_tzdb_list
1542/// - reload_tzdb
1543/// - sys_info
1544/// - local_info
1545/// - time_zone
1546/// - choose
1547/// - remote_version
1548/// - zoned_traits
1549/// - zoned_time
1550/// - zoned_seconds
1551/// - time_zone_link
1552/// - nonexistent_local_time
1553/// - ambiguous_local_time
1554/// - leap_second
1555/// - leap_second_info
1556///
1557/// This macro is defined if the standard `__cpp_lib_chrono` feature-test macro
1558/// has at least `201907L` value, and on GCC the compiler is allowed to use the
1559/// C++11 (or later) ABI.
1560///
1561/// This feature has been provided by MSVC++ compiler since VS 2019 16.10. But
1562/// that release was shipped with the following important note: "While the STL
1563/// generally provides all features on all supported versions of Windows, leap
1564/// seconds and time zones (which change over time) require OS support that was
1565/// added to Windows 10. Specifically, updating the leap second database
1566/// requires Windows 10 version 1809 or later, and time zones require `icu.dll`
1567/// which is provided by Windows 10 version 1903/19H1 or later. This applies to
1568/// both client and server OSes; note that Windows Server 2019 is based on
1569/// Windows 10 version 1809." If the feature is used on a host that does not
1570/// provide `icu.dll`, an exception with "The specified module could not be
1571/// found." message will be thrown. For this reason those features are disabled
1572/// by default on Windows.
1573///
1574/// This macro is defined first for the following compiler versions:
1575///
1576/// - Microsoft Visual Studio 2022 / MSVC 19.30
1577/// - GCC 14+
1578///
1579/// ## BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp20_version}
1580///
1581///
1582/// The `BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION` macro is defined if the native
1583/// standard library provides the `<version>` header and implements all required
1584/// content with no major issues.
1585///
1586/// A new header, `<version>`, that defines library feature-test macros has been
1587/// added in C++20. For better compatibility with the standard library
1588/// `BSLS_LIBRARYFEATURES` macros should be based on the standard feature test
1589/// macro when it is appropriate. See the "STANDARD FEATURE-DETECTION MACROS"
1590/// section below.
1591///
1592/// This macro is defined first for the following compiler versions:
1593///
1594/// - GCC 9
1595/// - clang 7, or clang using at least GCC 9 GNU C++ Library
1596/// - Microsoft Visual Studio 2019 16.2 / MSVC 19.22
1597///
1598/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_ALLOCATE_AT_LEAST {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_allocate_at_least}
1599///
1600///
1601/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_ALLOCATE_AT_LEAST` is defined if the
1602/// following C++23 features are available in the `<bsl_memory.h>` header:
1603/// - `bsl::allocator::allocate_at_least`
1604/// - `bsl::allocator_traits::allocate_at_least`
1605/// - `bsl::allocation_result`
1606///
1607/// Note that the standard feature test macro `__cpp_lib_allocate_at_least` is
1608/// also defined and has a value of at least `202302L`.
1609///
1610/// This macro is defined first for the following Standard Library
1611/// implementations:
1612///
1613/// - LLVM libc++ 15
1614/// - MSVC++ STL 19.30 (VS 2022 17.0)
1615///
1616/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_BASELINE_LIBRARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_baseline_library}
1617///
1618///
1619/// This macro is used to identify whether the current platform's standard
1620/// library supports a baseline set of C++23 library features (which are defined
1621/// below). This is especially important in BSL when importing standard library
1622/// functions and types into the `bsl::` namespace, as is done in `bsl+bslhdrs`.
1623///
1624/// This macro is defined if all of the listed conditions are true:
1625///
1626/// * The compiler supports C++23 language features.
1627/// * The `<bit>` header defines:
1628/// - `std::byteswap`
1629/// * The `<functional>` header defines:
1630/// - `std::invoke_r`
1631/// * The `<ios>` header defines:
1632/// - `std::ios_base::noreplace`
1633/// * The `<ranges>` header defines:
1634/// - `std::views::as_rvalue`, `std::ranges::as_rvalue_view`
1635/// - `std::views::chunk_by`, `std::ranges::chunk_by_view`
1636/// - `std::views::repeat`, `std::ranges::repeat_view`
1637/// * The `<type_traits>` header defines:
1638/// - `std::is_scoped_enum`, `std::is_scoped_enum_v`
1639/// * The `<utility>` header defines:
1640/// - `std::to_underlying`
1641/// - `std::unreachable`
1642/// * The `<memory>` header provides `constexpr` `std::unique_ptr`.
1643/// * The `<typeinfo>` header provides `constexpr` `std::type_info::operator==`.
1644/// * The `<iterator>` header provides random access `std::move_iterator<T*>`.
1645///
1646/// This macro is defined first for the following Standard Library
1647/// implementations:
1648///
1649/// - GNU libstdc++ 13
1650/// - LLVM libc++ 18
1651/// - MSVC++ STL 19.36 (VS 2022 17.6)
1652///
1653/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_BIND_BACK {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_bind_back}
1654///
1655///
1656/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_BIND_BACK` is defined if the C++23
1657/// `bsl::bind_back` function is available in the `<bsl_functional.h>` header.
1658///
1659/// Note that the standard feature test macro `__cpp_lib_bind_back` is also
1660/// defined and has a value of at least `202202L`.
1661///
1662/// This macro is defined first for the following Standard Library
1663/// implementations:
1664///
1665/// - GNU libstdc++ 14
1666/// - LLVM libc++ 19
1667/// - MSVC++ STL 19.34 (VS 2022 17.4)
1668///
1669/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_CONTAINERS_RANGES {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_containers_ranges}
1670///
1671///
1672/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_CONTAINERS_RANGES` is defined if the
1673/// C++23 `bsl::from_range_t` type and the `bsl::from_range` value are available
1674/// in the `<bsl_range.h>` header.
1675///
1676/// Note that the standard feature test macro `__cpp_lib_containers_ranges` is
1677/// also defined and has a value of at least `202202L`.
1678///
1679/// This macro is defined first for the following Standard Library
1680/// implementations:
1681///
1682/// - GNU libstdc++ 14 - partial, 15 - full
1683/// - LLVM libc++ 17
1684/// - MSVC++ STL 19.34 (VS 2022 17.4)
1685///
1686/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_FORWARD_LIKE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_forward_like}
1687///
1688///
1689/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_FORWARD_LIKE` is defined if the C++23
1690/// `bsl::forward_like` function is available in the `<bsl_utility.h>` header.
1691///
1692/// Note that the standard feature test macro `__cpp_lib_forward_like` is also
1693/// defined and has a value of at least `202207L`.
1694///
1695/// This macro is defined first for the following Standard Library
1696/// implementations:
1697///
1698/// - GNU libstdc++ 14
1699/// - LLVM libc++ 16
1700/// - MSVC++ STL 19.34 (VS 2022 17.4)
1701///
1702/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_GENERATOR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_generator}
1703///
1704///
1705/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_GENERATOR` is defined if the following
1706/// C++23 features are available:
1707/// - In the `<bsl_ranges.h>` header:
1708/// - `bsl::ranges::elements_of`
1709/// - In the `<bsl_generator.h>` header:
1710/// - `bsl::generator`
1711///
1712/// Note that the standard feature test macro `__cpp_lib_generator` is also
1713/// defined and has a value of at least `202207L`.
1714///
1715/// This macro is defined first for the following Standard Library
1716/// implementations:
1717///
1718/// - GNU libstdc++ 14
1719/// - MSVC++ STL 19.43 (VS 2022 17.13)
1720///
1721/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_INT_CHARCONV {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_int_charconv}
1722///
1723///
1724/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_INT_CHARCONV` macro is defined if the
1725/// `std::to_chars` and `std::from_chars` functions for all standard signed and
1726/// unsigned integer types and `char` provided by `<charconv>` are `constexpr`.
1727///
1728/// Note that the standard feature test macro `__cpp_lib_constexpr_charconv` is
1729/// also defined and has a value of at least `202207L`.
1730///
1731/// This macro is defined first for the following Standard Library
1732/// implementations:
1733///
1734/// - GNU libstdc++ 13
1735/// - MSVC++ STL 19.36 (VS 2022 17.6)
1736///
1737/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_IS_IMPLICIT_LIFETIME {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_is_implicit_lifetime}
1738///
1739///
1740/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_IS_IMPLICIT_LIFETIME` is defined if the
1741/// following C++23 features are available in the `<bsl_type_traits.h>` header:
1742/// - `bsl::is_implicit_lifetime`
1743/// - `bsl::is_implicit_lifetime_v`
1744///
1745/// Note that the standard feature test macro `__cpp_lib_is_implicit_lifetime`
1746/// is also defined and has a value of at least `202302L`.
1747///
1748/// This macro is defined first for the following Standard Library
1749/// implementations:
1750///
1751/// - LLVM libc++ 20
1752///
1753/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_MDSPAN {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_mdspan}
1754///
1755///
1756/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_MDSPAN` is defined if the following
1757/// C++23 features are available:
1758/// - In the `<bsl_mdspan.h>` header:
1759/// - `bsl::default_accessor`
1760/// - `bsl::dextents`
1761/// - `bsl::extents`
1762/// - `bsl::layout_left`
1763/// - `bsl::layout_right`
1764/// - `bsl::layout_stride`
1765/// - `bsl::mdspan`
1766///
1767/// Note that the standard feature test macro `__cpp_lib_mdspan` is also
1768/// defined and has a value of at least `202207L`.
1769///
1770/// This macro is defined first for the following Standard Library
1771/// implementations:
1772///
1773/// - MSVC++ STL 19.39 (VS 2022 17.9)
1774/// - LLVM libc++ 18
1775///
1776/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_OUT_PTR {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_out_ptr}
1777///
1778///
1779/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_OUT_PTR` is defined if the following
1780/// C++23 features are available in the `<bsl_memory.h>` header:
1781/// - `bsl::out_ptr`, `bsl::out_ptr_t`
1782/// - `bsl::inout_ptr`, `bsl::inout_ptr_t`
1783///
1784/// Note that the standard feature test macro `__cpp_lib_out_ptr` is also
1785/// defined and has a value of at least `202106L`.
1786///
1787/// This macro is defined first for the following Standard Library
1788/// implementations:
1789///
1790/// - GNU libstdc++ 14
1791/// - LLVM libc++ 16
1792/// - MSVC++ STL 19.30 (VS 2022 17.0)
1793///
1794/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_PRINT {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_print}
1795///
1796///
1797/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_PRINT` macro is defined if the native
1798/// standard library provides the `<print>` header and implements all required
1799/// C++23 content, including the DRs from C++26, with no major issues.
1800///
1801/// Note that the standard feature test macro `__cpp_lib_print` is also defined
1802/// and has a value of at least `202403L`.
1803///
1804/// This macro is defined first for the following Standard Library
1805/// implementations:
1806///
1807/// - MSVC++ STL 19.41 (VS 2022 17.11)
1808///
1809/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGE_ADAPTOR_CLOSURE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_range_adaptor_closure}
1810///
1811///
1812/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGE_ADAPTOR_CLOSURE` is defined if the
1813/// C++23 `bsl::ranges::range_adaptor_closure` class is available in the
1814/// `<bsl_range.h>` header.
1815///
1816/// Note that the standard feature test macro `__cpp_lib_ranges` is also defined
1817/// and has a value of at least `202202L`.
1818///
1819/// This macro is defined first for the following Standard Library
1820/// implementations:
1821///
1822/// - GNU libstdc++ 13
1823/// - LLVM libc++ 19
1824/// - MSVC++ STL 19.34 (VS 2022 17.4)
1825///
1826/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CARTESIAN_PRODUCT {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_cartesian_product}
1827///
1828///
1829/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CARTESIAN_PRODUCT` is defined if
1830/// the C++23 `bsl::views::cartesian_product` view and the
1831/// `bsl::ranges::cartesian_product_view` class are available in the
1832/// `<bsl_range.h>` header.
1833///
1834/// Note that the standard feature test macro
1835/// `__cpp_lib_ranges_cartesian_product` is also defined and has a value of at
1836/// least `202207L`.
1837///
1838/// This macro is defined first for the following Standard Library
1839/// implementations:
1840///
1841/// - GNU libstdc++ 13
1842/// - MSVC++ STL 19.37 (VS 2022 17.7)
1843///
1844/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CHUNK {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_chunk}
1845///
1846///
1847/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CHUNK` is defined if the C++23
1848/// `bsl::views::chunk` view and the `bsl::ranges::chunk_view` class are
1849/// available in the `<bsl_range.h>` header.
1850///
1851/// Note that the standard feature test macro `__cpp_lib_ranges_chunk` is also
1852/// defined and has a value of at least `202202L`.
1853///
1854/// This macro is defined first for the following Standard Library
1855/// implementations:
1856///
1857/// - GNU libstdc++ 13
1858/// - MSVC++ STL 19.33 (VS 2022 17.3)
1859///
1860/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_ENUMERATE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_enumerate}
1861///
1862///
1863/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_ENUMERATE` is defined if the
1864/// C++23 `bsl::views::enumerate` view and the `bsl::ranges::enumerate_view`
1865/// class are available in the `<bsl_range.h>` header.
1866///
1867/// Note that the standard feature test macro `__cpp_lib_ranges_enumerate` is
1868/// also defined and has a value of at least `202302L`.
1869///
1870/// This macro is defined first for the following Standard Library
1871/// implementations:
1872///
1873/// - GNU libstdc++ 13
1874/// - MSVC++ STL 19.37 (VS 2022 17.7)
1875///
1876/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGE_FORMAT {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_range_format}
1877///
1878///
1879/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGE_FORMAT` macro is defined when the
1880/// range formatting support of C++23 (P2286R8, P2585R1, LWG3750) is present in
1881/// the `<format>` header and it is in a usable state.
1882///
1883/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_AS_CONST {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_as_const}
1884///
1885///
1886/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_AS_CONST` is defined if the
1887/// following C++23 features are available:
1888/// - In the `<bsl_iterator.h>` header:
1889/// - `bsl::const_iterator`
1890/// - `bsl::const_sentinel`
1891/// - `bsl::basic_const_iterator`
1892/// - `bsl::make_const_iterator`
1893/// - `bsl::make_const_sentinel`
1894/// - `bsl::iter_const_reference_t`
1895/// - In the `<bsl_ranges.h>` header:
1896/// - `bsl::ranges::const_iterator_t`
1897/// - `bsl::ranges::const_sentinel_t`
1898/// - `bsl::ranges::range_const_reference_t`
1899/// - `bsl::ranges::constant_range`
1900/// - `bsl::ranges::as_const_view`
1901/// - `bsl::views::as_const`
1902///
1903/// Note that the standard feature test macro `__cpp_lib_ranges_as_const` is
1904/// also defined and has a value of at least `202207L`.
1905///
1906/// This macro is defined first for the following Standard Library
1907/// implementations:
1908///
1909/// - GNU libstdc++ 13
1910/// - MSVC++ STL 19.36 (VS 2022 17.6)
1911///
1912/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CONTAINS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_contains}
1913///
1914///
1915/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CONTAINS` is defined if the
1916/// following C++23 features are available in the `<bsl_algorithm.h>` header:
1917/// - `bsl::ranges::contains`
1918/// - `bsl::ranges::contains_subrange`
1919///
1920/// Note that the standard feature test macro `__cpp_lib_ranges_contains` is
1921/// also defined and has a value of at least `202207L`.
1922///
1923/// This macro is defined first for the following Standard Library
1924/// implementations:
1925///
1926/// - GNU libstdc++ 13
1927/// - LLVM libc++ 19
1928/// - MSVC++ STL 19.34 (VS 2022 17.4)
1929///
1930/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_FIND_LAST {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_find_last}
1931///
1932///
1933/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_FIND_LAST` is defined if the
1934/// following C++23 features are available in the `<bsl_algorithm.h>` header:
1935/// - `bsl::ranges::find_last`
1936/// - `bsl::ranges::find_last_if`
1937/// - `bsl::ranges::find_last_if_not`
1938///
1939/// Note that the standard feature test macro `__cpp_lib_ranges_find_last` is
1940/// also defined and has a value of at least `202207L`.
1941///
1942/// This macro is defined first for the following Standard Library
1943/// implementations:
1944///
1945/// - GNU libstdc++ 13
1946/// - LLVM libc++ 19
1947/// - MSVC++ STL 19.36 (VS 2022 17.6)
1948///
1949/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_FOLD {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_fold}
1950///
1951///
1952/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_FOLD` is defined if the following
1953/// C++23 features are available in the `<bsl_algorithm.h>` header:
1954/// - `bsl::ranges::fold_left`
1955/// - `bsl::ranges::fold_left_with_iter`
1956/// - `bsl::ranges::fold_left_with_iter_result`
1957/// - `bsl::ranges::fold_left_first`
1958/// - `bsl::ranges::fold_left_first_with_iter`
1959/// - `bsl::ranges::fold_left_first_with_iter_result`
1960/// - `bsl::ranges::fold_right`
1961/// - `bsl::ranges::fold_right_last`
1962/// - `bsl::ranges::in_value_result`
1963///
1964/// Note that the standard feature test macro `__cpp_lib_ranges_fold` is also
1965/// defined and has a value of at least `202207L`.
1966///
1967/// This macro is defined first for the following Standard Library
1968/// implementations:
1969///
1970/// - GNU libstdc++ 13
1971/// - MSVC++ STL 19.34 (VS 2022 17.4)
1972///
1973/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_IOTA {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_iota}
1974///
1975///
1976/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_IOTA` is defined if the following
1977/// C++23 features are available:
1978/// - In the `<bsl_numeric.h>` header:
1979/// - `bsl::ranges::iota`
1980/// - `bsl::ranges::iota_result`
1981/// - In the `<bsl_algorithm.h>` header:
1982/// - `bsl::ranges::out_value_result`
1983///
1984/// Note that the standard feature test macro `__cpp_lib_ranges_iota` is also
1985/// defined and has a value of at least `202202L`.
1986///
1987/// This macro is defined first for the following Standard Library
1988/// implementations:
1989///
1990/// - GNU libstdc++ 14
1991/// - MSVC++ STL 19.34 (VS 2022 17.4)
1992///
1993/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_JOIN_WITH {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_join_with}
1994///
1995///
1996/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_JOIN_WITH` is defined if the
1997/// C++23 `bsl::views::join_with` view and the `bsl::ranges::join_with_view`
1998/// class are available in the `<bsl_range.h>` header.
1999///
2000/// Note that the standard feature test macro `__cpp_lib_ranges_join_with` is
2001/// also defined and has a value of at least `202202L`.
2002///
2003/// This macro is defined first for the following Standard Library
2004/// implementations:
2005///
2006/// - GNU libstdc++ 13
2007/// - MSVC++ STL 19.34 (VS 2022 17.4)
2008///
2009/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_SHIFT {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_shift}
2010///
2011///
2012/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_SHIFT` is defined if the
2013/// following C++23 features are available in the `<bsl_algorithm.h>` header:
2014/// - `bsl::ranges::shift_left`
2015/// - `bsl::ranges::shift_right`
2016///
2017/// Note that the standard feature test macro `__cpp_lib_shift` is also defined
2018/// and has a value of at least `202202L`.
2019///
2020/// This macro is defined first for the following Standard Library
2021/// implementations:
2022///
2023/// - MSVC++ STL 19.34 (VS 2022 17.5)
2024///
2025/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_SLIDE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_slide}
2026///
2027///
2028/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_SLIDE` is defined if the C++23
2029/// `bsl::views::slide` view and the `bsl::ranges::slide_view` class are
2030/// available in the `<bsl_range.h>` header.
2031///
2032/// Note that the standard feature test macro `__cpp_lib_ranges_slide` is also
2033/// defined and has a value of at least `202202L`.
2034///
2035/// This macro is defined first for the following Standard Library
2036/// implementations:
2037///
2038/// - GNU libstdc++ 13
2039/// - MSVC++ STL 19.33 (VS 2022 17.3)
2040///
2041/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_STARTS_ENDS_WITH {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_starts_ends_with}
2042///
2043///
2044/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_STARTS_ENDS_WITH` is defined if
2045/// the following C++23 features are available in the `<bsl_algorithm.h>`
2046/// header:
2047/// - `bsl::ranges::starts_with`
2048/// - `bsl::ranges::ends_with`
2049///
2050/// Note that the standard feature test macro
2051/// `__cpp_lib_ranges_starts_ends_with` is also defined and has a value of at
2052/// least `202106L`.
2053///
2054/// This macro is defined first for the following Standard Library
2055/// implementations:
2056///
2057/// - LLVM libc++ 18
2058/// - MSVC++ STL 19.31 (VS 2022 17.1)
2059///
2060/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_STRIDE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_stride}
2061///
2062///
2063/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_STRIDE` is defined if the C++23
2064/// `bsl::views::stride` view and the `bsl::ranges::stride_view` class are
2065/// available in the `<bsl_range.h>` header.
2066///
2067/// Note that the standard feature test macro `__cpp_lib_ranges_stride` is also
2068/// defined and has a value of at least `202207L`.
2069///
2070/// This macro is defined first for the following Standard Library
2071/// implementations:
2072///
2073/// - GNU libstdc++ 13
2074/// - MSVC++ STL 19.34 (VS 2022 17.4)
2075///
2076/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_TO_CONTAINER {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_to_container}
2077///
2078///
2079/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_TO_CONTAINER` is defined if the
2080/// C++23 `bsl::ranges::to` function is available in the `<bsl_range.h>` header.
2081///
2082/// Note that the standard feature test macro `__cpp_lib_ranges_to_container` is
2083/// also defined and has a value of at least `202202L`.
2084///
2085/// This macro is defined first for the following Standard Library
2086/// implementations:
2087///
2088/// - GNU libstdc++ 14 - partial, 15 - full
2089/// - LLVM libc++ 17
2090/// - MSVC++ STL 19.34 (VS 2022 17.4)
2091///
2092/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_ZIP {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_ranges_zip}
2093///
2094///
2095/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_ZIP` is defined if the following
2096/// C++23 features are available in the `<bsl_range.h>` header:
2097/// - `bsl::views::adjacent`, `bsl::ranges::adjacent_view`
2098/// - `bsl::views::adjacent_transform`, `bsl::ranges::adjacent_transform_view`
2099/// - `bsl::views::zip`, `bsl::ranges::zip_view`
2100/// - `bsl::views::zip_transform`, `bsl::ranges::zip_transform_view`
2101///
2102/// Note that the standard feature test macro `__cpp_lib_ranges_zip` is also
2103/// defined and has a value of at least `202110L`.
2104///
2105/// This macro is defined first for the following Standard Library
2106/// implementations:
2107///
2108/// - GNU libstdc++ 13
2109/// - MSVC++ STL 19.37 (VS 2022 17.7)
2110///
2111/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_REFERENCE_FROM_TEMPORARY {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_reference_from_temporary}
2112///
2113///
2114/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_REFERENCE_FROM_TEMPORARY` is defined if
2115/// the following C++23 features are available in the `<bsl_type_traits.h>`
2116/// header:
2117/// - `bsl::reference_constructs_from_temporary`
2118/// - `bsl::reference_constructs_from_temporary_v`
2119/// - `bsl::reference_converts_from_temporary`
2120/// - `bsl::reference_converts_from_temporary_v`
2121///
2122/// Note that the standard feature test macro
2123/// `__cpp_lib_reference_from_temporary` is also defined and has a value of at
2124/// least `202202L`.
2125///
2126/// This macro is defined first for the following Standard Library
2127/// implementations:
2128///
2129/// - GNU libstdc++ 14
2130///
2131/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_SPANSTREAM {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_spanstream}
2132///
2133///
2134/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_SPANSTREAM` is defined if the following
2135/// C++23 features are available:
2136/// - In the `<bsl_spanstream.h>` header:
2137/// - `bsl::basic_ispanstream`
2138/// - `bsl::basic_ospanstream`
2139/// - `bsl::basic_spanbuf`
2140/// - `bsl::basic_spanstream`
2141/// - `bsl::ispanstream`
2142/// - `bsl::ospanstream`
2143/// - `bsl::spanbuf`
2144/// - `bsl::spanstream`
2145/// - `bsl::wspanbuf`
2146/// - `bsl::wispanstream`
2147/// - `bsl::wospanstream`
2148/// - `bsl::wspanstream`
2149///
2150/// Note that the standard feature test macro `__cpp_lib_spanstream` is also
2151/// defined and has a value of at least `202106L`.
2152///
2153/// This macro is defined first for the following Standard Library
2154/// implementations:
2155///
2156/// - GNU libstdc++ 13
2157/// - MSVC++ STL 19.31 (VS 2022 17.1)
2158///
2159/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_STACKTRACE {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_stacktrace}
2160///
2161///
2162/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_STACKTRACE` is defined if the following
2163/// C++23 features are available in the `<bsl_stacktrace.h>` header:
2164/// - `bsl::basic_stacktrace`
2165/// - `bsl::stacktrace`
2166/// - `bsl::stacktrace_entry`
2167///
2168/// Note that the standard feature test macro `__cpp_lib_stacktrace` is also
2169/// defined and has a value of at least `202011L`.
2170///
2171/// This macro is defined first for the following Standard Library
2172/// implementations:
2173///
2174/// - (GNU libstdc++ 14) - requires linking with -lstdc++exp
2175/// - MSVC++ STL 19.34 (VS 2022 17.4)
2176///
2177/// ## BSLS_LIBRARYFEATURES_HAS_CPP23_START_LIFETIME_AS {#bsls_libraryfeatures-bsls_libraryfeatures_has_cpp23_start_lifetime_as}
2178///
2179///
2180/// The `BSLS_LIBRARYFEATURES_HAS_CPP23_START_LIFETIME_AS` is defined if the
2181/// following C++23 features are available in the `<bsl_memory.h>` header:
2182/// - `bsl::start_lifetime_as`
2183/// - `bsl::start_lifetime_as_array`
2184///
2185/// Note that the standard feature test macro `__cpp_lib_start_lifetime_as` is
2186/// also defined and has a value of at least `202207L`.
2187///
2188/// This macro is defined first for the following Standard Library
2189/// implementations:
2190///
2191/// - ?
2192///
2193/// ## BSLS_LIBRARYFEATURES_STDCPP_GNU {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_gnu}
2194///
2195///
2196/// The `BSLS_LIBRARYFEATURES_STDCPP_GNU` macro is defined if the C++ standard
2197/// library implementation is GNU libstdc++.
2198///
2199/// ## BSLS_LIBRARYFEATURES_STDCPP_IBM {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_ibm}
2200///
2201///
2202/// The `BSLS_LIBRARYFEATURES_STDCPP_IBM` macro is defined if the C++ standard
2203/// library implementation is IBM's VACPP.
2204///
2205/// ## BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_intellisense}
2206///
2207///
2208/// The `BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE` macro is defined if
2209/// Microsoft's Intellisense is running (instead of a production compiler).
2210/// Note that detecting Intellisense does *not* mean that the MSVC compiler is
2211/// used. Visual Studio 2017 is capable of cross platform development using
2212/// clang and Visual Studio Code (also featuring Intellisense) may be used with
2213/// virtually any compiler.
2214///
2215/// ## BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_libcstd}
2216///
2217///
2218/// The `BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD` macro is defined if the C++
2219/// standard library implementation is a Rogue Wave implementation.
2220///
2221/// ## BSLS_LIBRARYFEATURES_STDCPP_LLVM {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_llvm}
2222///
2223///
2224/// The `BSLS_LIBRARYFEATURES_STDCPP_LLVM_LIBCPP` macro is defined if the C++
2225/// standard library implementation is LLVM's libc++.
2226///
2227/// ## BSLS_LIBRARYFEATURES_STDCPP_MSVC {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_msvc}
2228///
2229///
2230/// The `BSLS_LIBRARYFEATURES_STDCPP_MSVC` macro is defined if the C++ standard
2231/// library implementation is Microsoft's (Dinkumware based) implementation.
2232///
2233/// ## BSLS_LIBRARYFEATURES_STDCPP_STLPORT {#bsls_libraryfeatures-bsls_libraryfeatures_stdcpp_stlport}
2234///
2235///
2236/// The `BSLS_LIBRARYFEATURES_STDCPP_STLPORT` macro is defined if the C++
2237/// standard library implementation is an STLPort implementation.
2238///
2239/// ## Usage {#bsls_libraryfeatures-usage}
2240///
2241///
2242/// In this section we show intended usage of this component.
2243///
2244/// ### Example 1: Managing Library-Dependent Interfaces {#bsls_libraryfeatures-example-1-managing-library-dependent-interfaces}
2245///
2246///
2247/// When building software across multiple platforms a programmer may have to
2248/// deal with different versions of the native standard library, some providing
2249/// features that the others do not. The macros defined in this component can
2250/// be used make features visible only if the required native standard library
2251/// features are present.
2252///
2253/// For example, the `tuple`-type is not available in older versions of the
2254/// native standard library. Suppose we have a utility component that returns
2255/// an instance of a `tuple` of values *if* the underlying version of the
2256/// standard library provides that type, and yet remain compilable otherwise.
2257///
2258/// First, we conditionally include the header file we will need if we define an
2259/// interface that returns a `std::tuple`.
2260/// @code
2261/// #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE)
2262/// # include <tuple> {#bsls_libraryfeatures-include-tuple}
2263///
2264/// #endif // BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
2265/// @endcode
2266/// Then, we declare the methods that will be unconditionally provided by our
2267/// utility component:
2268/// @code
2269/// struct MyStatisticalUtil
2270/// {
2271/// /// Return the median (mean, variance) of the sequence of values in
2272/// /// the specified non-empty, semi-open range `[begin, end)`. The
2273/// /// behavior is undefined unless `begin < end`.
2274/// static double mean(const int *begin, const int *end);
2275/// static int median(const int *begin, const int *end);
2276/// static double variance(const int *begin, const int *end);
2277/// @endcode
2278/// Now, we conditionally define an interface that returns a `std::tuple`, if
2279/// that type is available. Note that, if all three values are needed, calling
2280/// this interface is more efficient than calling the earlier three individually
2281/// because the input need be traversed one time, not three, and if C++17 is
2282/// enabled the result may be used to create a structured binding.
2283/// @code
2284/// #ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
2285/// /// Return the median, mean, and variance (in that order) of the
2286/// /// sequence of values in the specified non-empty, semi-open range
2287/// /// `[begin, end)`. The behavior is undefined unless `begin < end`.
2288/// static std::tuple<int, double, double> getMedianMeanVariance(
2289/// const int *begin,
2290/// const int *end);
2291/// #endif // BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
2292/// };
2293/// @endcode
2294/// Finally, we find that our code compiles when we build our code against
2295/// versions of the native standard library that provide a `tuple` type, *and*
2296/// those that do not. Of course, in the later case the interface that returns
2297/// a `tuple` is not defined for the `MyStatisticalUtil` `struct`.
2298/// @}
2299/** @} */
2300/** @} */
2301
2302/** @addtogroup bsl
2303 * @{
2304 */
2305/** @addtogroup bsls
2306 * @{
2307 */
2308/** @addtogroup bsls_libraryfeatures
2309 * @{
2310 */
2311
2312// ----------------------------------------------------------------------------
2313//
2314// ####################################################################
2315// ########################################################################
2316// ## ##
2317// ## THIS HEADER FILE HAS SPECIAL FORMATTING RULES! ##
2318// ## ************************************************ ##
2319// ## ##
2320// ## Please follow the rules below when updating it. ##
2321// ## ##
2322// ########################################################################
2323// ####################################################################
2324//
2325// This header is a large and complex mesh of fairly unrelated and deep
2326// preprocessor conditionals with defining and undefining of many feature
2327// macros. It is hard for a human to scan this file and understand how and
2328// where particular feature macros are set. To make matter more difficult in
2329// certain circumstances we also unset/undefine macros. For this reason this
2330// header file uses a few special formatting rules to allow faster scanning:
2331//
2332// 1. Only comments and the `1` (replacement text) of {Binary Macros} may be 79
2333// characters long (plus newline). Line continuation characters in long
2334// preprocessor conditionals etc. must be placed onto column 78. This is to
2335// allow a human to easily scan the file for places where feature macros are
2336// being defined.
2337// 2. Feature macro definitions that are commented out (to indicate that for a
2338// given compiler + standard library combination the support does not exist)
2339// must not have the replacement text (the number 1) be present so as not to
2340// confuse a human reader not using syntax highlighting.
2341// 3. Due to the depth of necessary conditional branches (`#if*`) and the
2342// unusually long feature macro names defined in this header we use 2 spaces
2343// indentation to ensure that most preprocessor directives do not wrap (and
2344// become hard to read).
2345//
2346// ----------------------------------------------------------------------------
2347
2348#include <bsls_compilerfeatures.h>
2349#include <bsls_linkcoercion.h>
2350#include <bsls_platform.h>
2351
2352// ============================================================================
2353// STANDARD LIBRARY DETECTION
2354// ----------------------------------------------------------------------------
2355
2356#define BSLS_LIBRARYFEATURES_DETECTION_IN_PROGRESS
2357// We are including a *standard* header to get the macros defined that allow us
2358// to determine what standard library implementation we have. Do *not* change
2359// these to any other header. These headers were selected because they do not
2360// include (m)any other standard headers *and* they do not define any dangerous
2361// (non-uppercase) macros. `<ciso646>` would define dangerous macros on
2362// Microsoft platform, so we use the standard header `<cstddef>` to get to the
2363// platform-determining macros. `<ciso646>` is effectively empty on older GNU
2364// implementations, so we also include `<cstddef>`.
2365
2366#ifdef BSLS_COMPILERFEATURES_SUPPORT_HAS_INCLUDE
2367// On platforms that support it we use `__has_include` to give a better error
2368// message if/when our assumptions about the platforms and its supported header
2369// files break.
2370
2371// First we determine if we have clang that uses the GNU library. We need this
2372// info because for the GNU library we need to include a different header, not
2373// `<ciso646>`, because `<ciso646>` does not define the required macros prior
2374// to version 6.1. See http://en.cppreference.com/w/cpp/header/ciso646
2375
2376# if defined(BSLS_PLATFORM_CMP_CLANG)
2377# if __has_include(<bits/c++config.h>)
2378# define BSLS_LIBRARYFEATURES_SUSPECT_CLANG_WITH_GLIBCPP 1
2379# endif
2380# endif
2381
2382# ifdef BSLS_PLATFORM_CMP_MSVC
2383# if !__has_include(<yvals.h>)
2384# error Standard library implementation detection is broken.
2385 // The implementation specific header file <yvals.h> we assumed
2386 // exists is not found. This may be the result of either a new
2387 // major library version from Microsoft (that breaks with
2388 // tradition), or an unexpected standard library implementation
2389 // being used with the Microsoft compiler instead of the usual
2390 // Microsoft implementation. This detection logic needs to be
2391 // updated to also support this new situation.
2392# endif
2393
2394# elif defined(BSLS_PLATFORM_CMP_GNU) || \
2395 defined(BSLS_LIBRARYFEATURES_SUSPECT_CLANG_WITH_GLIBCPP)
2396# if !__has_include(<bits/c++config.h>)
2397# error Standard library implementation detection is broken.
2398 // The implementation specific header file <bits/c++config.h> we
2399 // assumed exists is not found. This may be the result of either
2400 // a new major C++ library version from GNU (that breaks with
2401 // tradition), or an unexpected standard library implementation
2402 // being used with the GNU compiler instead of the usual libstdc++.
2403 // This detection logic needs to be updated to also support this
2404 // new situation.
2405# endif
2406
2407# elif defined(BSLS_PLATFORM_CMP_SUN)
2408# if !__has_include(<valarray>)
2409# error Standard library implementation detection has failed.
2410 BSLS_PLATFORM_COMPILER_ERROR; // Sun ignores `#error`
2411 // The implementation specific header file <valarray> we assumed
2412 // exists is not found. Since `<valarray>` is in every ISO C++
2413 // standard (library) it is very likely that this error is caused
2414 // by a broken build configuration, such as trying to compile C++
2415 // source code files as C, or some other reason why the compiler
2416 // cannot see the C++ standard library header files.
2417# endif
2418
2419# elif BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
2420# if !__has_include(<version>)
2421# error Standard library implementation detection is broken.
2422 // The implementation specific header file <version> we assumed
2423 // exists is not found. Since `<version>` is part of ISO C++2020
2424 // standard (library) it is very likely that this error is caused
2425 // by either a broken build configuration, or this untested
2426 // compiler reporting C++20 compatibility that it does not have.
2427 // Build configuration issues may be trying to compile a C++
2428 // source code files as C, or some other reason why the compiler
2429 // cannot see the C++ standard library header files. If that is
2430 // not the case this detection logic has to be extended to support
2431 // this failing build platform.
2432# endif
2433
2434# else
2435# if !__has_include(<ciso646>)
2436# error Standard library implementation detection is broken.
2437 // The implementation specific header file <ciso646> we assumed
2438 // exists is not found. Since `<ciso646>` part of every ISO C++
2439 // standard (library) before C++20 it is very likely that this
2440 // error is caused by a broken build configuration, such as trying
2441 // to compile C++ source code files as C, or some other reason why
2442 // the compiler cannot see the C++ standard library header files.
2443 // If that is not the case this detection logic has to be extended
2444 // to support this failing build platform.
2445# endif
2446# endif
2447
2448#endif // `__has_include` is supported
2449
2450// Include a header from the standard library implementation that defines the
2451// macros that we use for detection, and is "cheap" either because most headers
2452// of the implementation will `#include` it, or because it is a relatively
2453// small header.
2454
2455#ifdef BSLS_PLATFORM_CMP_MSVC
2456# include <cstddef>
2457#elif defined(BSLS_PLATFORM_CMP_GNU) || \
2458 defined(BSLS_LIBRARYFEATURES_SUSPECT_CLANG_WITH_GLIBCPP)
2459# include <cstddef>
2460# if defined(BSLS_LIBRARYFEATURES_SUSPECT_CLANG_WITH_GLIBCPP)
2461 // Prevent macro pollution
2462# undef BSLS_LIBRARYFEATURES_SUSPECT_CLANG_WITH_GLIBCPP
2463# endif
2464#elif defined(BSLS_PLATFORM_CMP_SUN)
2465 // Unfortunately, SUN does *nothing* in its `<ciso646>`, or its `<exception>`
2466 // headers. Its `<new>`, and `<typeinfo>` headers are shared between the
2467 // Rogue Wave and the STLPort implementations, so they do not define anything
2468 // standard library specific (see
2469 // https://docs.oracle.com/cd/E19205-01/819-5267/6n7c46e4p/index.html
2470 // 12.7.1), therefore we have to include something that is different between
2471 // Rogue Wave and STLPort implementations. All such headers are large, not
2472 // cheap. :(
2473# include <valarray>
2474#else
2475# include <ciso646>
2476#endif
2477
2478// The implementation detection logic itself. Note that on IBM we just detect
2479// the compiler, because the IBM library does not define a specific version
2480// macro.
2481
2482#if defined (__GLIBCPP__) || defined(__GLIBCXX__)
2483# define BSLS_LIBRARYFEATURES_STDCPP_GNU 1
2484#elif defined(_CPPLIB_VER) || (defined(_YVALS) && !defined(__IBMCPP__))
2485# define BSLS_LIBRARYFEATURES_STDCPP_MSVC 1
2486#elif defined(_LIBCPP_VERSION)
2487# define BSLS_LIBRARYFEATURES_STDCPP_LLVM 1
2488#elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
2489# define BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD 1
2490#elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
2491# define BSLS_LIBRARYFEATURES_STDCPP_STLPORT 1
2492#elif defined(__IBMCPP__)
2493# define BSLS_LIBRARYFEATURES_STDCPP_IBM 1
2494#elif defined(__INTELLISENSE__)
2495# define BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE 1
2496#else
2497# error Could not determine standard library platform.
2498#endif
2499
2500// Enforce known restrictions that might indicate a bad configuration
2501#if defined(__apple_build_version__) && (__APPLE_CC__ >= 6000)
2502 // For ABI compatibility the Apple Clang compiler must use the platform
2503 // standard library, which is the LLVM libc++ library.
2504 //
2505 // The presence of the `__apple_build_version__` macro means that the
2506 // compiler is the one provided by Apple (and not brew.sh, MacPorts, or
2507 // built-from-source). However, it is defined for both legacy Apple GCC
2508 // and for modern Apple Clang.
2509 //
2510 // `__APPLE_CC__` is always defined for compilers supplied by Apple. The
2511 // macro indicates the compiler version in both legacy Apple GCC and the
2512 // modern Apple Clang. Its value is frozen at `6000` to indicate a Clang
2513 // compiler by using a revision greater than the highest value for any
2514 // Apple GCC build. Hence all Clang compilers clearly detect as more
2515 // modern when building legacy code that might still support building with
2516 // GCC, but different Clang specific macros should be tested to determine
2517 // the specific version of Apple Clang.
2518 //
2519 // `__APPLE_CC__` is also defined by the open source LLVM Clang compiler as
2520 // necessary for compatibility with the Apple Clang compiler, but not the
2521 // `__apple_build_version__` macro, so testing for the combination of both
2522 // macros uniquely indicates an Apple Clang compiler.
2523# if !defined(BSLS_LIBRARYFEATURES_STDCPP_LLVM)
2524# error Apple Clang is configured with a non-standard library
2525# endif
2526#endif
2527
2528// Library detection is complete.
2529#undef BSLS_LIBRARYFEATURES_DETECTION_IN_PROGRESS
2530
2531// ============================================================================
2532// STANDARD FEATURE-DETECTION-MACRO-BASED PROCESSING
2533// ----------------------------------------------------------------------------
2534
2535// Starting with C++20 `__cpp_lib_*` macros indicating the presence of C++
2536// Standard library features is guaranteed by the ISO standard. All such
2537// macros for the supported library features are guaranteed to be defined in
2538// the `<version>` standard header, and in additional headers related to the
2539// feature. This section defines our C++20 or later feature macros that are
2540// based on the standard feature macros. Note that one-to-one mapping is not
2541// guaranteed as we do not report any C++20 library functionality supported
2542// unless a minimum baseline of features are present. It may also be necessary
2543// for us to consider a feature not supported, despite the standard macro being
2544// set, if there are issues in a certain implementation that prevent effective
2545// and/or safe use within the BDE libraries.
2546
2547#if defined(BSLS_COMPILERFEATURES_SUPPORT_HAS_INCLUDE)
2548# if __has_include(<version>)
2549 // C++20 is the standard that required the `<version>` header but many
2550 // libraries shipped it earlier, and its inclusion is not based on
2551 // which C++ language version is used.
2552# define BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION 1
2553# include <version>
2554# endif
2555#endif
2556
2557// For standards that specify the `<version>` header, we must first determine
2558// whether the BDE baseline feature set for the library is available, as users
2559// can depend on the `_HAS_CPPxx_BASELINE_LIBRARY` feature set when testing
2560// any other feature macro for that edition of the Standard.
2561
2562#if BSLS_LIBRARYFEATURES_STDCPP_GNU
2563 /// Detect C++20 baseline features
2564# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L // At least C++20
2565# if _GLIBCXX_RELEASE >= 11
2566# define BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY 1
2567# endif
2568# endif
2569
2570 /// Detect C++23 baseline features
2571# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202100L // At least C++23;
2572# if _GLIBCXX_RELEASE >= 13
2573# define BSLS_LIBRARYFEATURES_HAS_CPP23_BASELINE_LIBRARY 1
2574# endif
2575# endif
2576
2577#elif defined(BSLS_LIBRARYFEATURES_STDCPP_LLVM)
2578 /// Detect C++20 baseline features
2579# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L // At least C++20
2580# if _LIBCPP_VERSION >= 150000
2581# define BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY 1
2582# endif
2583# endif
2584
2585 /// Detect C++23 baseline features
2586# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202302L // At least C++23
2587# if _LIBCPP_VERSION >= 180000
2588# define BSLS_LIBRARYFEATURES_HAS_CPP23_BASELINE_LIBRARY 1
2589# endif
2590# endif
2591
2592#elif defined(BSLS_PLATFORM_CMP_MSVC)
2593# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
2594 // C++20 baseline introduced in Visual Studio 2022 (update 17.0.1)
2595# if BSLS_PLATFORM_CMP_VERSION >= 1930
2596# define BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY 1
2597# endif
2598# endif // At least C++20
2599
2600 // C++23 baseline introduced in Visual Studio 2022 update 17.6
2601
2602 // MSVC does not define __cplusplus > 202004L until v19.43 (VS 17.13)
2603# if BSLS_COMPILERFEATURES_CPLUSPLUS > 202002L // More than C++20
2604 // VS 2022 17.6
2605# if BSLS_PLATFORM_CMP_VERSION >= 1936
2606# define BSLS_LIBRARYFEATURES_HAS_CPP23_BASELINE_LIBRARY 1
2607# endif
2608# endif // At least C++23
2609#endif
2610
2611// ============================================================================
2612// UNIVERSAL FEATURE SUPPORT DEFINITIONS
2613// ----------------------------------------------------------------------------
2614
2615// Define macros for C++98 features that may be detected as absent from later
2616// standards. All removed libraries will have their macros undefined in a
2617// consistent manner at the end of this header
2618
2619/// Set unconditionally for compilers supporting an earlier standard than
2620/// C++14; this feature macro will be undefined for those platforms with
2621/// partial support for C++14, implementing the removal of this dangerous
2622/// function.
2623#define BSLS_LIBRARYFEATURES_HAS_C90_GETS 1
2624
2625/// Set unconditionally. This features is found on each compiler
2626/// version/platform combination tested. Assume universally available until
2627/// the day tool chains start removing this deprecated class template.
2628#define BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR 1
2629
2630#if BSLS_COMPILERFEATURES_CPLUSPLUS < 202002L
2631 /// These APIs should be removed in C++20. Undefined conditionally
2632 /// later in this file for implementations that still have it.
2633# define BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API 1
2634#endif
2635
2636#if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201703L
2637 /// These APIs should be removed in C++17. Undefined conditionally
2638 /// later in this file for implementations that still have it.
2639# define BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED 1
2640#endif
2641
2642#if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
2643 /// These APIs should be removed in C++20. Undefined conditionally
2644 /// later in this file for implementations that still have it.
2645# define BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED 1
2646#endif
2647
2648// ============================================================================
2649// PLATFORM INDEPENDENT FEATURE DETECTION
2650// ----------------------------------------------------------------------------
2651
2652// Define non-baseline feature macros for C++20 and beyond by testing the
2653// values of the standard feature macros provided by the `<version>` header.
2654// If we determine that the advertised support is not complete or correct
2655// enough for BDE code to rely on by a given implementation, the feature macro
2656// will be undefined in that library's support section below. Otherwise the
2657// specific library support sections for C++20 and beyond should be empty.
2658
2659#if defined(BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY)
2660 // Additional non-baseline features are available only when we have detected
2661 // support for the baseline C++20 standard library functionality, which also
2662 // indicates that C++20 (or later) is enabled.
2663
2664# if defined(__cpp_lib_atomic_flag_test) && \
2665 __cpp_lib_atomic_flag_test >= 201907L && \
2666 !defined(BSLS_LIBRARYFEATURES_STDCPP_GNU)
2667# define BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_FLAG_TEST_FREE_FUNCTIONS 1
2668# endif
2669
2670# if defined(__cpp_lib_atomic_lock_free_type_aliases) && \
2671 __cpp_lib_atomic_lock_free_type_aliases >= 201907L
2672# define BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_LOCK_FREE_TYPE_ALIASES 1
2673# endif
2674
2675# if defined(__cpp_lib_atomic_ref) && \
2676 __cpp_lib_atomic_ref >= 201806L
2677# define BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_REF 1
2678# endif
2679
2680# if defined(__cpp_lib_atomic_wait) && __cpp_lib_atomic_wait >= 201907L && \
2681 !defined(BSLS_LIBRARYFEATURES_STDCPP_GNU)
2682# define BSLS_LIBRARYFEATURES_HAS_CPP20_ATOMIC_WAIT_FREE_FUNCTIONS 1
2683# endif
2684
2685# if defined(__cpp_lib_chrono) && __cpp_lib_chrono >= 201907L
2686# define BSLS_LIBRARYFEATURES_HAS_CPP20_CALENDAR 1
2687
2688# if !defined(BSLS_LIBRARYFEATURES_STDCPP_GNU) || _GLIBCXX_USE_CXX11_ABI \
2689 || !_GLIBCXX_USE_DUAL_ABI
2690 // GCC's standard library supports the timezone features only if the
2691 // C++11 ABI, or dual ABI is enabled.
2692# define BSLS_LIBRARYFEATURES_HAS_CPP20_TIMEZONE 1
2693# endif
2694# endif
2695
2696 /// The following macro is not defined as it is not covered by any C++20
2697 /// standard feature test macro and the feature it represents not supported
2698 /// by any current compilers.
2699 //#define BSLS_LIBRARYFEATURES_HAS_CPP20_CHAR8_MB_CONV
2700
2701# if defined(__cpp_lib_concepts) && __cpp_lib_concepts >= 202002L
2702# define BSLS_LIBRARYFEATURES_HAS_CPP20_CONCEPTS 1
2703# endif
2704
2705 /// Format support is complicated:
2706 /// - libstdc++ 13.1 defines the feature test macro to be 202106L even
2707 /// though they *do* implement P2372 and P2418, which bumped the feature
2708 /// test macro to 202110L. This is GCC bug 111826.
2709 ///
2710 /// - libc++ does not define the feature test macro as of version 17 because
2711 /// they have not implemented chrono time zones yet. We would prefer to
2712 /// use libc++'s `<format>` despite the missing functionality, because we
2713 /// will not be backporting the formatters for chrono time zones anyway.
2714 /// However, until release 20.1.0 there is a severe bug with handling
2715 /// fixed length character arrays in the implementation of `std::format`
2716 /// (see https://github.com/llvm/llvm-project/issues/115935) so we disable
2717 /// the feature even if the standard feature test macro is defined.
2718 ///
2719 /// - MSVC uses the correct value.
2720# if (defined(__cpp_lib_format) && __cpp_lib_format >= 202110L) || \
2721 (defined(BSLS_LIBRARYFEATURES_STDCPP_GNU) && _GLIBCXX_RELEASE >= 13) || \
2722 (defined(BSLS_LIBRARYFEATURES_STDCPP_LLVM) && _LIBCPP_VERSION >= 210100L)
2723# define BSLS_LIBRARYFEATURES_HAS_CPP20_FORMAT 1
2724# endif
2725 /// But also, an older version of Clang might be used with a newer version of
2726 /// libstdc++. In that case, the use of `std::format` may result in errors
2727 /// because Clang `consteval` support was buggy prior to version 17 (see
2728 /// https://github.com/llvm/llvm-project/commit/e328d68).
2729 /// TBD: is this a concern only for the old ABI short string, that we now
2730 /// have a macro to detect?
2731# if (defined(BSLS_PLATFORM_CMP_CLANG) && BSLS_PLATFORM_CMP_VERSION < 170000L)
2732# undef BSLS_LIBRARYFEATURES_HAS_CPP20_FORMAT
2733# endif
2734
2735 /// Per the final sentence of 'P0466R5', the availability of
2736 /// `std::is_corresponding_member` is linked to the availability of
2737 /// `std::is_layout_compatible`.
2738# if defined(__cpp_lib_is_layout_compatible) && \
2739 __cpp_lib_is_layout_compatible >= 201907L
2740# define BSLS_LIBRARYFEATURES_HAS_CPP20_IS_CORRESPONDING_MEMBER 1
2741# define BSLS_LIBRARYFEATURES_HAS_CPP20_IS_LAYOUT_COMPATIBLE 1
2742# endif
2743
2744# if defined(__cpp_lib_is_pointer_interconvertible) && \
2745 __cpp_lib_is_pointer_interconvertible >= 201907L
2746# define BSLS_LIBRARYFEATURES_HAS_CPP20_IS_POINTER_INTERCONVERTIBLE 1
2747# endif
2748
2749# if defined(__cpp_lib_jthread) && __cpp_lib_jthread >= 201911L
2750# define BSLS_LIBRARYFEATURES_HAS_CPP20_JTHREAD 1
2751# endif
2752
2753# if (defined(__cpp_lib_smart_ptr_for_overwrite) && \
2754 __cpp_lib_smart_ptr_for_overwrite >= 202002L) || \
2755 (defined(BSLS_LIBRARYFEATURES_STDCPP_GNU) && \
2756 (_GLIBCXX_RELEASE == 11 || _GLIBCXX_RELEASE == 12))
2757 // GNU libstdc++ 11 & 12 do not define the macro but define the functions.
2758# define BSLS_LIBRARYFEATURES_HAS_CPP20_MAKE_UNIQUE_FOR_OVERWRITE 1
2759# endif
2760
2761# if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 202110L && \
2762 !(defined(BSLS_PLATFORM_CMP_CLANG) && \
2763 BSLS_PLATFORM_CMP_VERSION < 160000 && \
2764 defined(BSLS_LIBRARYFEATURES_STDCPP_GNU))
2765 // Clang 15 does not implement deferred instantiation of `requires`
2766 // clauses, which is necessary to build libstdc++ ranges.
2767# define BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES 1
2768# endif
2769
2770# if defined(__cpp_lib_source_location) && \
2771 __cpp_lib_source_location >= 201907L
2772# define BSLS_LIBRARYFEATURES_HAS_CPP20_SOURCE_LOCATION 1
2773# endif
2774
2775# if defined(__cpp_lib_syncbuf) && __cpp_lib_syncbuf >= 201803L
2776# define BSLS_LIBRARYFEATURES_HAS_CPP20_SYNCSTREAM 1
2777# endif
2778
2779# if defined(__cpp_lib_to_array) && __cpp_lib_to_array >= 201907L
2780# define BSLS_LIBRARYFEATURES_HAS_CPP20_TO_ARRAY 1
2781# endif
2782#endif // BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY
2783
2784#if defined(BSLS_LIBRARYFEATURES_HAS_CPP23_BASELINE_LIBRARY)
2785 /// Feature macros are defined by the `<version>` header, which was already
2786 /// included by library detection above. We make individual, additional
2787 /// features available only when we claim to support the baseline C++23
2788 /// standard library functionality.
2789
2790# if defined(__cpp_lib_allocate_at_least) && \
2791 __cpp_lib_allocate_at_least >= 202302L
2792# define BSLS_LIBRARYFEATURES_HAS_CPP23_ALLOCATE_AT_LEAST 1
2793# endif
2794
2795# if defined(__cpp_lib_bind_back) && __cpp_lib_bind_back >= 202202L
2796# define BSLS_LIBRARYFEATURES_HAS_CPP23_BIND_BACK 1
2797# endif
2798
2799# if defined(__cpp_lib_constexpr_charconv) && \
2800 __cpp_lib_constexpr_charconv >= 202207L
2801# define BSLS_LIBRARYFEATURES_HAS_CPP23_INT_CHARCONV 1
2802# endif
2803
2804# if defined(__cpp_lib_containers_ranges) && \
2805 __cpp_lib_containers_ranges >= 202202L
2806# define BSLS_LIBRARYFEATURES_HAS_CPP23_CONTAINERS_RANGES 1
2807# endif
2808
2809# if defined(__cpp_lib_forward_like) && __cpp_lib_forward_like >= 202207L
2810# define BSLS_LIBRARYFEATURES_HAS_CPP23_FORWARD_LIKE 1
2811# endif
2812
2813# if defined(__cpp_lib_generator) && __cpp_lib_generator >= 202207L
2814# define BSLS_LIBRARYFEATURES_HAS_CPP23_GENERATOR 1
2815# endif
2816
2817# if defined(__cpp_lib_is_implicit_lifetime) && \
2818 __cpp_lib_is_implicit_lifetime >= 202302L
2819# define BSLS_LIBRARYFEATURES_HAS_CPP23_IS_IMPLICIT_LIFETIME 1
2820# endif
2821
2822# if defined(__cpp_lib_mdspan) && __cpp_lib_mdspan >= 202207L
2823# if !__has_include(<mdspan>)
2824# error Platform claims to support <mdspan> but the header is not found
2825# endif
2826# define BSLS_LIBRARYFEATURES_HAS_CPP23_MDSPAN 1
2827# endif
2828
2829# if defined(__cpp_lib_out_ptr) && __cpp_lib_out_ptr >= 202106L
2830# define BSLS_LIBRARYFEATURES_HAS_CPP23_OUT_PTR 1
2831# endif
2832
2833# if defined(__cpp_lib_print) && __cpp_lib_print >= 202403L
2834# define BSLS_LIBRARYFEATURES_HAS_CPP23_PRINT 1
2835# endif
2836
2837# if defined(__cpp_lib_ranges) && __cpp_lib_ranges >= 202202L
2838# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGE_ADAPTOR_CLOSURE 1
2839# endif
2840
2841 /// Early support for C++23 interaction with C++20 ranges, this feature will
2842 /// not be supported in BDE when using our own implementation of `format`.
2843 /// Range formatter is implemented (P2286R8, P2585R1, LWG3750)
2844# if __cpp_lib_format_ranges >= 202207L && \
2845 defined(BSLS_LIBRARYFEATURES_HAS_CPP20_FORMAT)
2846# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGE_FORMAT 1
2847# endif
2848
2849# if defined(__cpp_lib_ranges_as_const) && __cpp_lib_ranges_as_const >= 202207L
2850# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_AS_CONST 1
2851# endif
2852
2853# if defined(__cpp_lib_ranges_cartesian_product) && \
2854 __cpp_lib_ranges_cartesian_product >= 202207L
2855# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CARTESIAN_PRODUCT 1
2856# endif
2857
2858# if defined(__cpp_lib_ranges_chunk) && __cpp_lib_ranges_chunk >= 202202L
2859# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CHUNK 1
2860# endif
2861
2862# if defined(__cpp_lib_ranges_contains) && __cpp_lib_ranges_contains >= 202207L
2863# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_CONTAINS 1
2864# endif
2865
2866# if defined(__cpp_lib_ranges_enumerate) && \
2867 __cpp_lib_ranges_enumerate >= 202302L
2868# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_ENUMERATE 1
2869# endif
2870
2871# if defined(__cpp_lib_ranges_find_last) && \
2872 __cpp_lib_ranges_find_last >= 202207L
2873# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_FIND_LAST 1
2874# endif
2875
2876# if defined(__cpp_lib_ranges_fold) && __cpp_lib_ranges_fold >= 202207L
2877# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_FOLD 1
2878# endif
2879
2880# if defined(__cpp_lib_ranges_iota) && __cpp_lib_ranges_iota >= 202202L && \
2881 !(defined(BSLS_LIBRARYFEATURES_STDCPP_GNU) && _GLIBCXX_RELEASE < 14)
2882 // GNU libstdc++ 13 does not implement the feature even though it defines
2883 // the macro.
2884# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_IOTA 1
2885# endif
2886
2887# if defined(__cpp_lib_ranges_join_with) && \
2888 __cpp_lib_ranges_join_with >= 202202L
2889# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_JOIN_WITH 1
2890# endif
2891
2892# if defined(__cpp_lib_shift) && __cpp_lib_shift >= 202202L
2893# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_SHIFT 1
2894# endif
2895
2896# if defined(__cpp_lib_ranges_slide) && __cpp_lib_ranges_slide >= 202202L
2897# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_SLIDE 1
2898# endif
2899
2900# if defined(__cpp_lib_ranges_starts_ends_with) && \
2901 __cpp_lib_ranges_starts_ends_with >= 202106L
2902# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_STARTS_ENDS_WITH 1
2903# endif
2904
2905# if defined(__cpp_lib_ranges_stride) && __cpp_lib_ranges_stride >= 202202L
2906# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_STRIDE 1
2907# endif
2908
2909# if defined(__cpp_lib_ranges_to_container) && \
2910 __cpp_lib_ranges_to_container >= 202202L
2911# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_TO_CONTAINER 1
2912# endif
2913
2914# if defined(__cpp_lib_ranges_zip) && __cpp_lib_ranges_zip >= 202110L
2915# define BSLS_LIBRARYFEATURES_HAS_CPP23_RANGES_ZIP 1
2916# endif
2917
2918# if defined(__cpp_lib_reference_from_temporary) && \
2919 __cpp_lib_reference_from_temporary >= 202202L
2920# define BSLS_LIBRARYFEATURES_HAS_CPP23_REFERENCE_FROM_TEMPORARY 1
2921# endif
2922
2923# if defined(__cpp_lib_spanstream) && __cpp_lib_spanstream >= 202106L
2924# if !__has_include(<spanstream>)
2925# error Platform claims to support <spanstream> but the header is not found
2926# endif
2927# define BSLS_LIBRARYFEATURES_HAS_CPP23_SPANSTREAM 1
2928# endif
2929
2930# if defined(__cpp_lib_stacktrace) && __cpp_lib_stacktrace >= 202011L
2931 // GNU libstdc++ 14 requires linking with -lstdc++exp
2932# ifndef BSLS_LIBRARYFEATURES_STDCPP_GNU
2933# define BSLS_LIBRARYFEATURES_HAS_CPP23_STACKTRACE 1
2934# endif
2935# endif
2936
2937# if defined(__cpp_lib_start_lifetime_as) && \
2938 __cpp_lib_start_lifetime_as >= 202207L
2939# define BSLS_LIBRARYFEATURES_HAS_CPP23_START_LIFETIME_AS 1
2940# endif
2941#endif
2942
2943// ============================================================================
2944// PLATFORM SPECIFIC FEATURE DETECTION
2945// ----------------------------------------------------------------------------
2946
2947// Using the appropriate library versioning macros, apply feature detection
2948// logic based upon the library version for library features prior to C++20.
2949
2950#if BSLS_LIBRARYFEATURES_STDCPP_GNU && _GLIBCXX_RELEASE >= 7
2951/// The Gnu libstdc++ for GCC 6 gained a version macro, `_GLIBCXX_RELEASE` with
2952/// a value indicating the release of GCC associated with that library. As
2953/// multiple compilers can be configured to use this library, we prefer to
2954/// perform feature-detection independent of compiler and version when this
2955/// library is chosen. For earlier releases of this compiler see support for
2956/// legacy libraries in a subsequent header section.
2957///
2958///
2959/// \note Note that several feature checks rely on tests for the associated Gnu C
2960/// library, glibc. This library is part of the Linux operating system, and
2961/// it is assumed that this Gnu library will be shipped on non-Linux
2962/// platforms when the Gnu libstdc++ Standard Library is ported.
2963
2964 /// The GCC standard library offers two ABIs for @ref basic_string , the legacy
2965 /// C++98 version using the CoW string optimization (Copy on Write) and the
2966 /// modern C++11 version using the short string optimization, and which is
2967 /// the only version that implements `constexpr` operations for the string.
2968 ///
2969 /// \note Note that the choice of string ABI is unrelated to the language version
2970 /// and is a valid choice for C++03.
2971# if _GLIBCXX_USE_CXX11_ABI
2972# define BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING 1
2973# endif
2974
2975 /// C features are controlled independently of C++ dialect, and will be set
2976 /// by the library configuration for C++11 or later build.
2977# if _GLIBCXX_USE_C99 == 1
2978# define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY 1
2979# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201103L // At least C++11
2980# define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY 1
2981 // `snprintf` is also available in C++03 builds with new GCC versions
2982# define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF 1
2983# endif
2984# endif
2985
2986 /// `__cpp_lib_atomic_is_always_lock_free` is defined in the `<version>`
2987 /// header, and the `<atomic>` header. We prefer to include the `<version>`
2988 /// header if it exists as it is not only a lot smaller and less complicated,
2989 /// but also already included by library detection when available.
2990# if !BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION && __has_include(<atomic>)
2991# include <atomic>
2992# endif
2993
2994 /// There is no pre-processor macro declared in libstdc++ to indicate that
2995 /// precise bitwidth atomics exist, but the libstdc++ shipping with GGC 7
2996 /// also includes lock-free support in C++17 mode. That feature does
2997 /// include a pre-processor definition, so use it as a stand-in for
2998 /// detecting precise bitwidth atomics. This pre-processor macro will
2999 /// already be defined only when compiling in at least C++17 standard mode,
3000 /// so there is no need for an additional check.
3001# if defined(__cpp_lib_atomic_is_always_lock_free)
3002# define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS 1
3003# endif
3004
3005 /// Detect C++11 features
3006# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201103L
3007# define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY 1
3008# define BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS 1
3009# define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING 1
3010# define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API 1
3011# define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES 1
3012# define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR 1
3013# define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS 1
3014# define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE 1
3015# define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE 1
3016# define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR 1
3017# if defined(_GLIBCXX_HAVE_AT_QUICK_EXIT) && \
3018 defined(_GLIBCXX_HAVE_QUICK_EXIT)
3019 // This feature depends on GLIBC exposing support by defining the above
3020 // two feature macros.
3021# define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION 1
3022# endif
3023# endif
3024
3025 /// Detect C++14 features
3026# if BSLS_COMPILERFEATURES_CPLUSPLUS > 201103L
3027# define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY 1
3028# define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS 1
3029 /// This macro is defined by a consistency rule at the end of this header.
3030// #define BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE
3031# endif
3032
3033 /// Detect C++17 features
3034# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201703L // At least C++17
3035# define BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY 1
3036# define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD 1
3037# define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS 1
3038# define BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS 1
3039# define BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS 1
3040
3041# ifdef _GLIBCXX_HAVE_ALIGNED_ALLOC
3042# define BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC 1
3043# endif
3044
3045# ifdef _GLIBCXX_HAVE_TIMESPEC_GET
3046# define BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET 1
3047# endif
3048
3049# if _GLIBCXX_RELEASE >= 8
3050# define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV 1
3051# endif
3052
3053# if _GLIBCXX_RELEASE >= 9
3054# define BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM 1
3055# define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR 1
3056 // Using production flag to temporary disable generic PMR support.
3057# if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING)
3058 // GNU libstdc++ does not support `pmr::string` when the
3059 // legacy Cow-string ABI is used.
3060# define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING 1
3061# endif
3062# endif
3063
3064# if _GLIBCXX_RELEASE >= 12
3065 // GCC 11 ships floating point support in <charconv>, but it is slow and
3066 // very buggy.
3067# define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV 1
3068# endif
3069# endif
3070
3071# if _GLIBCXX_USE_DEPRECATED
3072 // Note: defaults to `1` for all known libstdc++ versions, but can be
3073 // defined as `0` on the command line to remove a subset of zombie names.
3074# undef BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED
3075# undef BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
3076# endif
3077
3078 /// Platform specific corrections and workarounds
3079
3080 /// The C++17 searcher implementation did not ship until GCC 7.3, but the
3081 /// library versioning macro provides only the major version. However, we
3082 /// know that if we are specifically using the GCC compiler and it is on
3083 /// an earlier release of GCC7, then these library features will *not* be
3084 /// available
3085# if defined(BSLS_PLATFORM_CMP_GNU) && BSLS_PLATFORM_CMP_VERSION < 70301
3086# undef BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD
3087# undef BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
3088# endif
3089
3090 /// Audit remaining (unsupported) feature macros
3091 // Prior to GCC 14, Intel Thread Building Blocks (TBB) were required to be
3092 // used for full C++17 parallel algorithm support, linking with which was
3093 // not safe in the RHEL environment. GCC 14 can use OpenMP as a backend
3094 // instead, but requires `-fopenmp` flag to be supplied during compilation,
3095 // which BDE currently does not add. Enabling this flag requires further
3096 // investigation of its impact. See internal bug report 175302952.
3097 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS
3098
3099#elif defined(BSLS_LIBRARYFEATURES_STDCPP_LLVM)
3100/// The LLVM libc++ Standard Library uses the `_LIBCPP_VERSION` macro to indicate the library version.
3101///
3102/// \note Note that this value is consistent between
3103/// Apple Clang and the open source LLVM version of the libraries, so that this
3104/// macro is reliable without having to check the platform.
3105
3106# define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY 1
3107
3108 /// Detect C++11 features
3109# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201103L
3110# define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY 1
3111# define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF 1
3112# define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY 1
3113# define BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS 1
3114# define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING 1
3115# define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES 1
3116# define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR 1
3117# define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION 1
3118# define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS 1
3119# define BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING 1
3120# define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE 1
3121# define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE 1
3122# define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR 1
3123# endif
3124
3125 /// Detect C++14 features
3126# if BSLS_COMPILERFEATURES_CPLUSPLUS > 201103L
3127# define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY 1
3128# define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS 1
3129 /// This macro is defined by a consistency rule at the end of this header.
3130// #define BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE
3131# endif
3132
3133 /// Detect C++17 features
3134# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201703L
3135# define BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY 1
3136# define BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM 1
3137# define BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS 1
3138# define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD 1
3139
3140# ifdef _LIBCPP_HAS_ALIGNED_ALLOC
3141# define BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC 1
3142# endif
3143
3144# ifdef _LIBCPP_HAS_TIMESPEC_GET
3145# define BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET 1
3146# endif
3147
3148# if _LIBCPP_VERSION >= 170000
3149# define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR 1
3150# define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING 1
3151# endif
3152# endif // C++17
3153
3154 /// Audit remaining (unsupported) feature macros
3155// #define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
3156// #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV
3157// #define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV
3158// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS
3159// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS
3160// #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
3161// #define BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS
3162
3163
3164#elif defined(BSLS_PLATFORM_CMP_MSVC)
3165
3166 // Visual Studio feature detection code is based on
3167 // https://docs.microsoft.com/en-us/cpp/overview/ ->
3168 // visual-cpp-language-conformance
3169
3170 // We assume at least Visual Studio 2015
3171# define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY 1
3172# define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY 1
3173# define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF 1
3174# define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY 1
3175# define BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS 1
3176# define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING 1
3177# define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API 1
3178# define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES 1
3179# define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR 1
3180# define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION 1
3181# define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS 1
3182# define BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING 1
3183# define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE 1
3184# define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE 1
3185# define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR 1
3186# define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY 1
3187 /// This macro is defined by a consistency rule at the end of this header.
3188//# define BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE
3189# define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS 1
3190
3191# define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS 1
3192
3193 // Detect C++17 features
3194# if BSLS_COMPILERFEATURES_CPLUSPLUS > 201402L
3195
3196 // C++17 library features introduced in Visual Studio 2017
3197 // VS 2017 15.0
3198# if BSLS_PLATFORM_CMP_VERSION >= 1910
3199# define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD 1
3200# endif
3201
3202 // VS 2017 15.6
3203# if BSLS_PLATFORM_CMP_VERSION >= 1913
3204# define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR 1
3205# define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING 1
3206# define BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS 1
3207# endif
3208
3209 // VS 2017 15.7
3210# if BSLS_PLATFORM_CMP_VERSION >= 1914
3211# define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV 1
3212# define BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM 1
3213# define BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS 1
3214# endif
3215
3216 // VS 2017 15.8
3217# if BSLS_PLATFORM_CMP_VERSION >= 1915
3218 // MSVC 19.15 has the floating point `<charconv>` functions but they
3219 // do not report under and overflow properly.
3220 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV
3221# endif
3222
3223 // C++17 library features introduced in Visual Studio 2019
3224
3225 // VS 2019 16.0
3226# if BSLS_PLATFORM_CMP_VERSION >= 1920
3227# define BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY 1
3228# define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV 1
3229# define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS 1
3230# define BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS 1
3231# define BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET 1
3232# endif
3233# endif // C++17 features
3234
3235 // C++20 support reported
3236
3237# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 202002L
3238 // C++20 version header introduced in Visual Studio 2019
3239 // C++20 baseline features introduced in Visual Studio 2022
3240 // Remaining C++20 feature macros tested against <version> above, and
3241 // only buggy implementations will be undefined below:
3242 // (no known issues)
3243# endif // At least C++20
3244
3245 // MSVC does not define `__cplusplus` > 202004L until v19.43 (VS 17.13)
3246# if BSLS_COMPILERFEATURES_CPLUSPLUS > 202002L // More than C++20
3247
3248 // C++23 baseline features introduced in Visual Studio 2022 update 17.6
3249 // Remaining C++23 feature macros tested against <version> above, and
3250 // only buggy implementations will be undefined below:
3251 // (no known issues)
3252# endif // At least C++23
3253
3254 // Removal of deprecated standard library features
3255
3256 // Always apply this C++17 removal
3257# undef BSLS_LIBRARYFEATURES_HAS_C90_GETS
3258
3259 // MSVC has command line arguments that control support for whether
3260 // or not deprecated library features that have been removed by later
3261 // standards remain available using the provisions for zombie names.
3262
3263 // If `_HAS_AUTO_PTR_ETC` is defined and non-zero, the MSVC Standard
3264 // Library is configured to retain the library features removed by C++17.
3265# if _HAS_AUTO_PTR_ETC
3266# undef BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
3267# endif
3268
3269 // If `_HAS_FEATURES_REMOVED_IN_CXX20` is defined and non-zero, the MSVC
3270 // Standard Library is configured to retain the library features removed by
3271 // C++20.
3272# if _HAS_FEATURES_REMOVED_IN_CXX20
3273# undef BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED
3274# endif
3275
3276// ============================================================================
3277// C++11 SUPPORT ON LEGACY PLATFORMS
3278// ----------------------------------------------------------------------------
3279
3280/// Prior to GCC 7 there is no library versioning macro and we must instead
3281/// make assumptions dependent on the tool chain version. We assume a GCC
3282/// compiler is using the gnu libstdc++ library corresponding to that compiler
3283/// release. For non-GCC compilers things get trickier.
3284
3285#elif defined(BSLS_LIBRARYFEATURES_STDCPP_GNU) && \
3286 defined(BSLS_PLATFORM_CMP_GNU)
3287
3288# define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY 1
3289
3290 /// Detect C++11 features
3291# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201103L
3292# if BSLS_PLATFORM_CMP_VERSION >= 40800
3293# define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY 1
3294# define BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS 1
3295# define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING 1
3296# define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR 1
3297# define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS 1
3298# define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE 1
3299# define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR 1
3300# if defined(_GLIBCXX_HAVE_AT_QUICK_EXIT) && \
3301 defined(_GLIBCXX_HAVE_QUICK_EXIT)
3302 // This feature depends on GLIBC exposing support by defining
3303 // the above two pre-processor definitions.
3304# define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION 1
3305# endif
3306# if _GLIBCXX_USE_C99 == 1
3307 // C features are controlled independently of C++ dialect, and will be
3308 // set by the library configuration for C++11 or later build.
3309# define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY 1
3310 // `snprintf` is also available in C++03 builds with new GCC versions
3311# define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF 1
3312# endif
3313# endif // gcc 4.8
3314
3315# if BSLS_PLATFORM_CMP_VERSION >= 50000
3316# define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES 1
3317# define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE 1
3318# endif // gcc 5
3319
3320# if BSLS_PLATFORM_CMP_VERSION >= 60000
3321# define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API 1
3322# endif // gcc 6
3323
3324 // The GCC standard library offers two ABIs for @ref basic_string , the legacy
3325 // C++98 version using the CoW string optimization (Copy on Write) and the
3326 // modern C++11 version using the short string optimization, and which is
3327 // the only version that implements `constexpr` operations for the string.
3328 // Note that the choice of string ABI is unrelated to the language version
3329 // and is a valid choice for C++03.
3330# if _GLIBCXX_USE_CXX11_ABI
3331# define BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING 1
3332# endif
3333# endif // C++11 features
3334
3335 /// Detect C++14 features
3336# if BSLS_COMPILERFEATURES_CPLUSPLUS > 201103L
3337# define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY 1
3338# define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS 1
3339 /// This macro is defined by a consistency rule at the end of this header.
3340// #define BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE
3341
3342# endif // C++14 features
3343
3344 /// Audit remaining (unsupported) feature macros
3345// #define BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC
3346// #define BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3347// #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV
3348// #define BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
3349// #define BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM
3350// #define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV
3351// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS
3352// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR
3353// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
3354// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS
3355// #define BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS
3356// #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
3357// #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD
3358// #define BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS
3359// #define BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET
3360
3361#elif defined(BSLS_LIBRARYFEATURES_STDCPP_GNU) && \
3362 defined(BSLS_PLATFORM_CMP_CLANG)
3363
3364# define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY 1
3365
3366 // The GCC standard library offers two ABIs for @ref basic_string , the legacy
3367 // C++98 version using the CoW string optimization (Copy on Write) and the
3368 // modern C++11 version using the short string optimization, and which is
3369 // the only version that implements `constexpr` operations for the string.
3370 // Note that the choice of string ABI is unrelated to the language version
3371 // and is a valid choice for C++03.
3372# if _GLIBCXX_USE_CXX11_ABI
3373# define BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING 1
3374# endif
3375
3376 /// Detect C++11 features
3377# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201103L
3378# define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY 1
3379# define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF 1
3380# define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY 1
3381# define BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS 1
3382# define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING 1
3383# define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR 1
3384# define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS 1
3385# define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE 1
3386# define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE 1
3387# define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR 1
3388
3389 /// This macro would be defined if we had a way to detect that the
3390 /// installed libstdc++ standard library corresponds to GCC 5 or later.
3391 /// Unfortunately we can check only the compiler version, not the library
3392 /// version. This we will assume that if C++11 mode (or better) is enabled
3393 /// and the `__cplusplus` macro has been updated to at least the Standard
3394 /// value for C++11, then we have a version of the library that is fully
3395 /// conforming and we can define this feature macro.
3396# define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES 1
3397
3398 /// Assuming we are on Linux or another system built on top of the Gnu C
3399 /// runtime, glibc, assume a toolchain corresponding to GCC 4.8, and check GLIBC support for the feature.
3400 ///
3401 /// \note Note that this is effectively a test
3402 /// of the OS library, not the C++ standard library.
3403# if defined(_GLIBCXX_HAVE_AT_QUICK_EXIT) && \
3404 defined(_GLIBCXX_HAVE_QUICK_EXIT)
3405# define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION 1
3406# endif
3407# endif // C++11 features
3408
3409 /// Detect C++14 features
3410# if BSLS_COMPILERFEATURES_CPLUSPLUS > 201103L
3411# if BSLS_PLATFORM_CMP_VERSION >= 30400
3412# define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY 1
3413# define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS 1
3414 // This macro is defined by a consistency rule at the end of this header.
3415//# define BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE
3416
3417# endif
3418# endif // C++14 features
3419
3420 /// Audit remaining (unsupported) feature macros
3421// #define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
3422// #define BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC
3423// #define BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3424// #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV
3425// #define BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
3426// #define BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM
3427// #define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV
3428// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS
3429// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR
3430// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
3431// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS
3432// #define BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS
3433// #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
3434// #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD
3435// #define BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS
3436// #define BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET
3437
3438#elif defined(BSLS_LIBRARYFEATURES_STDCPP_GNU) \
3439 && defined(BSLS_PLATFORM_CMP_SUN)
3440// Here we assume that C++11 implies the Oracle-supplied GCC standard library.
3441// As these libraries all predate the addition of a versioning macro to that
3442// standard library, we must detect the library version based upon the Sun CC
3443// compiler version and assume the matching library.
3444
3445 /// Detect C++11 features
3446# if BSLS_COMPILERFEATURES_CPLUSPLUS >= 201103L
3447 // It would be simpler if we could simply identify as the corresponding
3448 // GCC library version: CC CMP_VERSION libstdc++ version
3449 // 12.4 0x5130 4.8.4
3450 // 12.5 0x5140 5.1.0
3451 // 12.6 0x5150 5.4.0
3452# if BSLS_PLATFORM_CMP_VERSION >= 0x5130
3453# define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY 1
3454# define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY 1
3455# define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF 1
3456# define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY 1
3457# define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING 1
3458# define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR 1
3459# define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS 1
3460# define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE 1
3461# define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE 1
3462# define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR 1
3463# endif
3464
3465# if BSLS_PLATFORM_CMP_VERSION >= 0x5140
3466# define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES 1
3467# endif
3468
3469# if BSLS_PLATFORM_CMP_VERSION >= 0x5150
3470 // Currently have an issue with rvalue-references on the CC 12.6
3471 // (beta) compiler, so undefining library feature macros that rely
3472 // on that language feature being marked as available
3473# undef BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
3474# undef BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
3475# undef BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR
3476# endif
3477# endif // C++11 features
3478
3479 /// Detect C++14 features
3480# if BSLS_COMPILERFEATURES_CPLUSPLUS > 201103L
3481# if BSLS_PLATFORM_CMP_VERSION >= 0x5140
3482# define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY 1
3483# define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS 1
3484 // This macro is defined by a consistency rule at the end of this header.
3485//# define BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE
3486# endif
3487# endif // C++14 features
3488
3489 /// Audit remaining (unsupported) feature macros
3490// #define BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS
3491// #define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
3492// #define BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING
3493// #define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION
3494// #define BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC
3495// #define BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3496// #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV
3497// #define BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
3498// #define BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM
3499// #define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV
3500// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS
3501// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR
3502// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
3503// #define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS
3504// #define BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS
3505// #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
3506// #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD
3507// #define BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS
3508// #define BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET
3509
3510// ============================================================================
3511// PLATFORMS WITH NO C++11 SUPPORT
3512// ----------------------------------------------------------------------------
3513
3514/// The following libraries never made the transition to C++11 so do not define
3515/// any of the feature macros for modern C++ libraries.
3516#elif defined(BSLS_LIBRARYFEATURES_STDCPP_IBM) \
3517 || defined(BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD) \
3518 || defined(BSLS_LIBRARYFEATURES_STDCPP_STLPORT)
3519
3520 // #define BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY
3521 // #define BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY
3522 // #define BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF
3523 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
3524 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS
3525 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING
3526 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
3527 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES
3528 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
3529 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION
3530 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS
3531 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_SHORT_STRING
3532 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
3533 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
3534 // #define BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR
3535 // #define BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY
3536 // #define BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE
3537 // #define BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS
3538 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC
3539 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3540 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV
3541 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
3542 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM
3543 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV
3544 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS
3545 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR
3546 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_PMR_STRING
3547 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS
3548 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS
3549 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
3550 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD
3551 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS
3552 // #define BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET
3553#endif
3554
3555// ============================================================================
3556// POST-DETECTION FIXUPS
3557// ----------------------------------------------------------------------------
3558
3559// Now, after detecting support, unconditionally undefine macros for features
3560// that have been removed from later standards.
3561
3562#if BSLS_COMPILERFEATURES_CPLUSPLUS > 201103L
3563 // `gets` is removed immediately from C++14, so undefine for any standard
3564 // version identifier greater than that of C++11.
3565# undef BSLS_LIBRARYFEATURES_HAS_C90_GETS
3566#endif
3567
3568#if defined(BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED)
3569 // `auto_ptr` is removed from C++17, so undefine for any standard version
3570 // identifier greater than that of C++14.
3571# undef BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR
3572#endif
3573
3574#if BSLS_COMPILERFEATURES_CPLUSPLUS > 202002L
3575 // Dynamic exception specifications were removed from most compiler before
3576 // C++23.
3577# undef BSLS_LIBRARYFEATURES_HAS_CPP11_DYNAMIC_EXCEPTION_SPECS
3578
3579 // The garbage collection support API is removed from C++23, so undefine
3580 // for any standard version identifier greater than that of C++20. Note
3581 // that some C++23 preview toolchains removed this API before the final
3582 // __cplusplus macro value for that standard was known, so we need to test
3583 // for "later standard than 2020".
3584# undef BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
3585#endif
3586
3587// Then, as a final consistency check, remove feature macros for modern
3588// features that rely on features defined by an earlier standard and that may
3589// be absent for the current build.
3590
3591 /// Verify that we have full support for integer `<charconv>` functions
3592 /// before enabling the `constexpr` versions.
3593#if defined(BSLS_LIBRARYFEATURES_HAS_CPP23_INT_CHARCONV) && \
3594 !defined(BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV)
3595# undef BSLS_LIBRARYFEATURES_HAS_CPP23_INT_CHARCONV
3596#endif
3597
3598// ============================================================================
3599// CONJUNCTION FEATURES
3600// ----------------------------------------------------------------------------
3601
3602// Now that we have detected and fixed up all features we may determine the
3603// presence of those that we know exist when their required features exist.
3604
3605#if BSLS_COMPILERFEATURES_FULL_CPP11
3606 /// It appears that all standard libraries make this C++14 feature available
3607 /// even in C++11 mode as it is so useful when implementing `tuple` features.
3608# define BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE 1
3609#endif
3610
3611// ============================================================================
3612// DEFINE ABI COMPATIBILITY AND LINK-SYMBOL
3613// ----------------------------------------------------------------------------
3614
3615// Here determine whether the ABI compatibility is the default for the current
3616// compiler, or a forced ABI compatibility configuration flag has been
3617// supplied. We create a coercion symbol to prevent linking against a binary
3618// incompatible translation unit.
3619
3620#undef BSLS_LIBRARYFEATURES_FORCE_ABI_ENABLED
3621#if defined(BSLS_LIBRARYFEATURES_FORCE_ABI_CPP11)
3622# ifndef BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
3623# error Cannot force C++11 ABI compatibility without at least C++11 support
3624# endif
3625# define BSLS_LIBRARYFEATURES_FORCE_ABI_ENABLED 11
3626# define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME \
3627 bsls_libraryfeatures_forced_CPP11_ABI
3628#endif
3629
3630#if defined(BSLS_LIBRARYFEATURES_FORCE_ABI_CPP17)
3631# ifndef BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
3632# error Cannot force C++17 ABI compatibility without at least C++17 support
3633# endif
3634# define BSLS_LIBRARYFEATURES_FORCE_ABI_ENABLED 17
3635# define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME \
3636 bsls_libraryfeatures_forced_CPP17_ABI
3637#endif
3638
3639#if defined(BSLS_LIBRARYFEATURES_FORCE_ABI_CPP20)
3640# ifndef BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY
3641# error Cannot force C++20 ABI compatibility without at least C++20 support
3642# endif
3643# define BSLS_LIBRARYFEATURES_FORCE_ABI_ENABLED 20
3644# define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME \
3645 bsls_libraryfeatures_forced_CPP20_ABI
3646#endif
3647
3648#if defined(BSLS_LIBRARYFEATURES_FORCE_ABI_CPP23)
3649# ifndef BSLS_LIBRARYFEATURES_HAS_CPP23_BASELINE_LIBRARY
3650# error Cannot force C++23 ABI compatibility without at least C++23 support
3651# endif
3652# define BSLS_LIBRARYFEATURES_FORCE_ABI_ENABLED 23
3653# define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME \
3654 bsls_libraryfeatures_forced_CPP23_ABI
3655#endif
3656
3657// ============================================================================
3658// DEFINE LINK-COERCION SYMBOL
3659// ----------------------------------------------------------------------------
3660
3661#ifndef BSLS_LIBRARYFEATURES_FORCE_ABI_ENABLED
3662
3663// Catch attempts to link C++14 objects with C++17 objects (for example).
3664
3665# if defined(BSLS_LIBRARYFEATURES_HAS_CPP23_BASELINE_LIBRARY)
3666# define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP23_ABI
3667# elif defined(BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY)
3668# define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP20_ABI
3669# elif defined(BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY)
3670# define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP17_ABI
3671# elif defined(BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY)
3672# define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP14_ABI
3673# elif defined(BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY)
3674# define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP11_ABI
3675# else
3676# define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME bsls_libraryfeatures_CPP03_ABI
3677# endif
3678
3679
3680
3683 const char *,
3684 bsls_libraryfeatures_assertion,
3685 BloombergLP::BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME)
3686
3687
3688#endif // BSLS_LIBRARYFEATURES_FORCE_ABI_ENABLED
3689
3690#endif // INCLUDED_BSLS_LIBRARYFEATURES
3691
3692// ----------------------------------------------------------------------------
3693// Copyright 2025 Bloomberg Finance L.P.
3694//
3695// Licensed under the Apache License, Version 2.0 (the "License");
3696// you may not use this file except in compliance with the License.
3697// You may obtain a copy of the License at
3698//
3699// http://www.apache.org/licenses/LICENSE-2.0
3700//
3701// Unless required by applicable law or agreed to in writing, software
3702// distributed under the License is distributed on an "AS IS" BASIS,
3703// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3704// See the License for the specific language governing permissions and
3705// limitations under the License.
3706// ----------------------------- END-OF-FILE ----------------------------------
3707
3708/** @} */
3709/** @} */
3710/** @} */
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
#define BSLS_LIBRARYFEATURES_LINKER_CHECK_NAME
Definition bsls_libraryfeatures.h:3668
#define BSLS_LINKCOERCION_FORCE_SYMBOL_DEPENDENCY(type, refName, referredSymbol)
Definition bsls_linkcoercion.h:203
#define BSLS_PLATFORM_COMPILER_ERROR
Definition bsls_platform.h:284