Quick Links: |
Provide macros to identify native standard library features. More...
Variables | |
const char * | bsls_libraryfeatures_CPP17_ABI |
BSLS_LIBRARYFEATURES_HAS_C90_GETS
BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY
BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY
BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF
BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR
BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API
BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY
BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE
BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY
BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY
BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING
BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES
BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS
BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD
BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED
BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION
BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS
BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS
BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR
BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT
: NOT DEFINED BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS
BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC
BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET
BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS
BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV
BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV
BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM
BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION
BSLS_LIBRARYFEATURES_HAS_CPP20_BARRIER
BSLS_LIBRARYFEATURES_HAS_CPP20_LATCH
BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES
BSLS_LIBRARYFEATURES_HAS_CPP20_SEMAPHORE
BSLS_LIBRARYFEATURES_HAS_CPP20_STOP_TOKEN
BSLS_LIBRARYFEATURES_STDCPP_GNU
BSLS_LIBRARYFEATURES_STDCPP_IBM
BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE
BSLS_LIBRARYFEATURES_STDCPP_LLVM
BSLS_LIBRARYFEATURES_STDCPP_MSVC
BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD
BSLS_LIBRARYFEATURES_STDCPP_STLPORT
BSLS_LIBRARYFEATURES_HAS_C90_GETS | C90 gets provided |
BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY | fpclassify et al. provided in std |
BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY | C99 library provided |
BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF | C99 snprintf provided |
BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR | auto_ptr provided |
BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API | adaptable function API provided |
BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY | C++11 base lib provided |
BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING | except handling provided |
BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API | GC support provided |
BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES | misc utils provided |
BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR | use "piecewise" |
BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION | "program exit" provided |
BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS | begin and end provided |
BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE | basic_stream move operations |
BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE | tuple provided |
BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR | unique_ptr provided |
BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY | C++14 base lib provided |
BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE | integer_sequence defined |
BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS | range functions extension |
BSLS_LIBRARYFEATURES_HAS_CPP17_BASELINE_LIBRARY | C++17 base lib provided |
BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT | NOT DEFINED see below |
BSLS_LIBRARYFEATURES_HAS_CPP17_EXCEPTION_HANDLING | except handling provided |
BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS | optional atomics |
BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS | searcher function objects |
BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD | searcher object overload |
BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED | ptr_fun et al. gone |
BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV | <charconv> for integers only |
BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV | full <charconv> support |
BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM | <filesystem> |
BSLS_LIBRARYFEATURES_HAS_CPP17_PARALLEL_ALGORITHMS | <execution> |
BSLS_LIBRARYFEATURES_HAS_CPP17_PMR | <memory_resource> |
BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET | <ctime> |
BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC | <cstdlib> |
BSLS_LIBRARYFEATURES_HAS_CPP20_BASELINE_LIBRARY | C++20 base lib provided |
BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED | result_of et al. gone |
BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION | <version> |
BSLS_LIBRARYFEATURES_HAS_CPP20_BARRIER | <barrier> |
BSLS_LIBRARYFEATURES_HAS_CPP20_LATCH | <latch> |
BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES | <ranges> |
BSLS_LIBRARYFEATURES_HAS_CPP20_SEMAPHORE | <semaphore> |
BSLS_LIBRARYFEATURES_HAS_CPP20_STOP_TOKEN | <stop_token> |
BSLS_LIBRARYFEATURES_STDCPP_GNU | implementation is GNU libstdc++ |
BSLS_LIBRARYFEATURES_STDCPP_IBM | implementation is IBM |
BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE | Intellisense is running |
BSLS_LIBRARYFEATURES_STDCPP_LLVM | implementation is LLVM libc++ |
BSLS_LIBRARYFEATURES_STDCPP_MSVC | implementation is MSVC |
BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD | implementation is Sun's (RogueWave) |
BSLS_LIBRARYFEATURES_STDCPP_STLPORT | implementation is STLPort |
BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
can be used to conditionally compile BDE code depending on those functions when they are available, and exclude that code when those functions are not present, thereby allowing compilation by earlier tool-chains. std
namespace. BSLS_LIBRARYFEATURES_HAS_C90_GETS
macro is defined if the gets
function (defined in <cstdio>
) is provided in namespace std
by the native standard library. This dangerous function is removed from the C++14 standard library, and its use with earlier dialects is strongly discouraged. BSLS_LIBRARYFEATURES_HAS_C99_FP_CLASSIFY
macro is defined if all of the listed floating-point classification functions, defined in the headers named below, are implemented by the native standard library in namespace std
: Functions defined in <cmath>
fpclassify
isfinite
isinf
isnan
isnormal
signbit
isgreater
isgreaterequal
isless
islessequal
islessgreater
isunordered
BSLS_LIBRARYFEATURES_HAS_C99_LIBRARY
macro is defined if all of the listed functions and types, defined in the headers named below, are implemented by the native standard library in namespace std
: Functions defined in <cctype>
isblank
Functions defined in <cmath>
double_t
float_t
acosh
asinh
atanh
cbrt
copysign
erf
erfc
exp2
expm1
fdim
fma
fmax
fmin
hypot
ilogb
lgamma
llrint
log1p
log2
logb
lrint
lround
llround
nan
nanl
nanf
nearbyint
nextafter
nexttoward
remainder
remquo
rint
round
scalbln
scalbn
tgamma
trunc
Functions defined in <cstdlib>
atoll
llabs
lldiv
lldiv_t
strtof
strtold
strtoll
strtoull
Functions defined in <cstdio>
vfscanf
vsscanf
vsnprintf
vsscanf
Functions defined in <cwchar>
vfwscanf
vswscanf
vwscanf
wcstof
wcstold
wcstoll
wcstoull
Functions defined in <cwctype>
iswblank
snprintf
as that is included in the separate BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF
macro. Also note that AIX and Solaris compilers generally have implementations of these functions in the global namespace when including the corresponding C header, but do not provide the standard C++ mapping. BSLS_LIBRARYFEATURES_HAS_C99_SNPRINTF
macro is defined if snprintf
function (defined in <cstdio>
) is implemented by the native standard library in namespace std
. Function defined in <cstdio>
snprintf
BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR
macro is defined if the auto_ptr
class template (defined in <memory>
) is provided by the native standard library. This macro is expected to be defined for all libraries/platforms at least until the introduction of C++17 to our build systems. BSLS_LIBRARYFEATURES_HAS_CPP98_BINDERS_API
macro is defined if the result_type
, argument_type
, first_argument_type
and second_argument_type
typedefs (defined in <functional>
) are provided by the native standard library. This macro is expected to be defined for all libraries/platforms at least until the introduction of C++20 to our build systems. BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
macro is used to identify whether the current platform's standard library supports a baseline set of C++11 library features (which are defined below). This is especially important in BSL when importing standard library functions and types into the bsl::
namespace, as is done in bsl+bslhdrs
. In particular this macro is used where C++11 has introduced new functions and types into headers available in older versions of the C++ standard. For example, C++11 introduced the type move_iterator
to the existing <iterator>
header, so bsl_iterator.h
uses this macro to determine whether to import std::move_iterator
into the bsl
namespace. The following functions and types are provided by the native standard library:
Functions defined in <algorithm>
all_of
any_of
copy_if
copy_n
find_if_not
is_heap
is_heap_until
is_partitioned
is_permutation
is_sorted
is_sorted_until
minmax
minmax_element
move
move_backward
none_of
partition_copy
partition_point
shuffle
Types defined in <atomic>
Functions defined in <complex>
acosh
asinh
atanh
proj
Functions and types defined in <exception>
current_exception
exception_ptr
rethrow_exception
Functions and types defined in <functional>
bind
bit_and
bit_or
bit_xor
cref
is_bind_expression
is_placeholder
mem_fn
ref
reference_wrapper
Functions defined in <iomanip>
get_money
put_money
Functions and types defined in <ios>
io_errc
iostream_category
is_error_code_enum
make_error_code
make_error_condition
hexfloat
defaultfloat
Functions defined in <iterator>
begin
end
move_iterator
make_move_iterator
next
prev
Function defined in <locale>
isblank
Functions defined in <memory>
addressof
pointer_traits
uninitialized_copy_n
Function defined in <numeric>
iota
Member function defined in <typeinfo>
type_info::hash_code
Functions defined in <utility>
declval
forward
move
move_if_noexcept
swap
random_shuffle
as that is deprecated in C++14 and will be removed in C++17. BSLS_LIBRARYFEATURES_HAS_CPP14_BASELINE_LIBRARY
macro is used to identify whether the current platform's standard library supports a baseline set of C++14 library features (which are defined below). This is especially important in BSL when importing standard library functions and types into the bsl::
namespace, as is done in bsl+bslhdrs
. The following functions and types are provided by the native standard library:
<complex>
Type defined in <functional>
Function defined in <iterator>
Function defined in <iomanip>
Function defined in <memory>
make_unique
Function defined in <type_traits>
is_null_pointer
is_final
Function defined in <utility>
exchange
BSLS_LIBRARYFEATURES_HAS_CPP14_INTEGER_SEQUENCE
macro is defined if all of the listed conditions are true: BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
macro is defined. BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES
macro is also defined. BSLS_COMPILERFEATURES_SUPPORT_ALIAS_TEMPLATES
macro is also defined. struct
integer_sequence
was introduced in the C++14 standard, bsl::integer_sequence
is supported by BDE when compiling in C++11 mode. bsl::
namespace, as is done in bsl+bslhdrs
. The following headers can be included:
bsl::
namespace, as is done in bsl+bslhdrs
. The following headers can be included:
BSLS_LIBRARYFEATURES_HAS_CPP11_EXCEPTION_HANDLING
macro is defined if both of the listed conditions are true: BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
macro is defined. The following functions and types are provided by the native standard library in <exception>
:
exception_ptr
make_exception_ptr
nested_exception
rethrow_if_nested
throw_with_nested
BSLS_LIBRARYFEATURES_HAS_CPP11_GARBAGE_COLLECTION_API
macro is defined if both of the listed conditions are true: BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
macro is defined. The following functions and types are provided by the native standard library in <memory>
:
declare_no_pointers
declare_reachable
get_pointer_safety
pointer_safety
undeclare_no_pointers
undeclare_reachable
BSLS_LIBRARYFEATURES_HAS_CPP11_MISCELLANEOUS_UTILITIES
macro is defined if both of the listed conditions are true: BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
macro is defined. The following functions and types are provided by the native standard library:
Type defined in <cstddef>
max_align_t
Functions defined in <exception>
get_terminate
get_unexpected
Functions defined in <iomanip>
get_time
put_time
Functions defined in <locale>
isblank
wstring_convert
wbuffer_convert
Function defined in <memory>
align
Class and function defined in <new>
bad_array_new_length
get_new_handler
get_unexpected
will be removed in C++17. BSLS_LIBRARYFEATURES_HAS_CPP11_PAIR_PIECEWISE_CONSTRUCTOR
macro is defined if the pair
class template (defined in <utility>
) provided by the native library has a constructor with the signature: template <class... Args1, class... Args2> pair(piecewise_construct_t , tuple<Args1...> first_args, tuple<Args2...> second_args);
piecewise_construct_t
(tag) type (defined in <utility>
) is provided by the native standard library. BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
macro is defined. BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES
macro is defined. BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
macro is defined. BSLS_LIBRARYFEATURES_HAS_CPP17_PRECISE_BITWIDTH_ATOMICS
macro is defined if both of the listed conditions are true: defined if the <atomic>
header provided by the native standard library provides type aliases for all of the following precise bit-width atomic types: BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
macro is defined. The following type aliases are provided by the native standard library in the <atomic>
header:
atomic_int8_t
atomic_int16_t
atomic_int32_t
atomic_int64_t
atomic_uint8_t
atomic_uint16_t
atomic_uint32_t
atomic_uint64_t
atomic_intptr_t
atomic_uintptr_t
BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_FUNCTORS
macro is defined if the native library supplies the following class templates in <functional>
: default_searcher
boyer_moore_searcher
boyer_moore_horspool_searcher
BSLS_LIBRARYFEATURES_HAS_CPP17_SEARCH_OVERLOAD
macro is defined if <algorithm>
defines an overload for the search
function template that accepts instances of the searcher classes introduced in C++17. See [alg.search]: template<class ForwardIterator, class Searcher> constexpr ForwardIterator std::search(ForwardIterator first, ForwardIterator last, const Searcher& searcher);
BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
macro is defined for libraries that do not export names removed in C++17, such as std::ptr_fun
. BSLS_LIBRARYFEATURES_HAS_CPP17_DEPRECATED_REMOVED
is generally the negation of BSLS_LIBRARYFEATURES_HAS_CPP98_AUTO_PTR
. Although the removal of deprecated C++17 types is conceptually equivalent to __cplusplus >= 201703L
, standard library implementations often provide configuration flags to expose the deprecated library features. BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED
macro is defined for libraries that do not export names removed in C++20, such as std::uncaught_exception
. Although these names remain present in some standard library implementations (e.g., gcc), BSLS_LIBRARYFEATURES_HAS_CPP20_DEPRECATED_REMOVED
is the equivalent of __cplusplus >= 202002L
. BSLS_LIBRARYFEATURES_HAS_CPP11_PROGRAM_TERMINATION
macro is defined if of the listed conditions are true: BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
macro is defined. <cstdlib>
header: _Exit
quick_exit
at_quick_exit
BSLS_LIBRARYFEATURES_HAS_CPP11_RANGE_FUNCTIONS
is defined if the following functions are provided by the native standard library in the <iterator>
header: template <class C> auto begin(C& c) -> decltype(c.begin()); template <class C> auto begin(const C& c) -> decltype(c.begin()); template <class C> auto end(C& c) -> decltype(c.end()); template <class C> auto end(const C& c) -> decltype(c.end()); template <class T, size_t N> T* begin(T (&array)[N]); template <class T, size_t N> T* end(T (&array)[N]);
BSLS_LIBRARYFEATURES_HAS_CPP14_RANGE_FUNCTIONS
macro is defined if the following functions are provided by the native standard library in the <iterator>
header: template <class C> auto cbegin(const C& c) -> decltype(std::begin(c)); template <class C> auto cend(const C& c) -> decltype(std::end(c)); template <class C> auto rbegin(C& c) -> decltype(c.rbegin()); template <class C> auto rbegin(const C& c) -> decltype(c.rbegin()); template <class C> auto rend(C& c) -> decltype(c.rend()); template <class C> auto rend(const C& c) -> decltype(c.rend()); template <class T, size_t N> reverse_iterator<T*> rbegin(T (&array)[N]); template <class T, size_t N> reverse_iterator<T*> rend(T (&array)[N]); template <class E> reverse_iterator<const E*> rbegin( initializer_list<E> il); template <class E> reverse_iterator<const E*> rend(initializer_list<E> il); template <class C> auto crbegin(const C& c) -> decltype(std::rbegin(c)); template <class C> auto crend(const C& c) -> decltype(std::rend(c));
BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
is defined if the standard stream classes (basic_istream
, basic_ostream
, basic_stream
) all have the C++11 mandated move operations (constructor and assignment operator) defined. Notice that the this macro is separate from the macro BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
as standard library implementations exist that implement almost all of C++11 (which is detected by the BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
macro) but not this feature. Note that when BSLS_LIBRARYFEATURES_HAS_CPP11_STREAM_MOVE
is defined BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
will also be defined, as the standard feature cannot be implemented without rvalue reference support from the compiler. Supported by the compiler vendor's STL implementation
BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
macro is defined if both of the listed conditions are true: BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
macro is defined. tuple
type template (defined in <tuple>
) is provided by the native standard library. BSLS_COMPILERFEATURES_SUPPORT_VARIADIC_TEMPLATES
macro is also defined. BSLS_LIBRARYFEATURES_HAS_CPP11_UNIQUE_PTR
macro is defined if both of the listed conditions are true: BSLS_LIBRARYFEATURES_HAS_CPP11_BASELINE_LIBRARY
macro is defined. unique_ptr
class template (defined in <memory>
) is provided by the native standard library. BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES
macro is also defined. BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT
macro is never defined and is mentioned in this component as documentation until its appearance in several BDE test drivers is removed. BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT
macro was intended to indicate whether or not the bool_constant
alias template (defined in <type_traits>
) is provided by the native standard library. It has since been discovered that, as bsl::integral_constant
is actually a distinct class template derived from std::integral_constant
, there must always be a distinct bsl
alias template, which will be provided in a future BDE release. Given this new direction, the need for a macro for the native type is obviated so BSLS_LIBRARYFEATURES_HAS_CPP17_BOOL_CONSTANT
is being removed. BSLS_LIBRARYFEATURES_HAS_CPP17_RANGE_FUNCTIONS
macro is defined if the following functions are provided by the native standard library in the <iterator>
header: template <class C> auto empty(const C& c) -> decltype(c.empty()); template <class C> auto data(const C& c) -> decltype(c.data()); template <class C> auto size(const C& c) -> decltype(c.size());
BSLS_LIBRARYFEATURES_HAS_CPP17_ALIGNED_ALLOC
macro is defined if the native standard library provides std::aligned_alloc
. BSLS_LIBRARYFEATURES_HAS_CPP17_TIMESPEC_GET
macro is defined if the native standard library provides std::timespec_get
. BSLS_LIBRARYFEATURES_HAS_CPP17_SPECIAL_MATH_FUNCTIONS
is defined if the special math functions such as std::assoc_laguerre
, std::beta
and others are provided by the native standard library in the <cmath>
header. BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV
macro is defined if the native standard library provides the <charconv> header and implements both std::from_chars
and std::to_chars
for all standard signed and unsigned integer types and the char
type, as well as the std::to_chars_result
and std::from_chars_result
types. BSLS_LIBRARYFEATURES_HAS_CPP17_CHARCONV
macro is defined if the native standard library provides the <charconv> header and implements all required content with no major issues. This macro is defined in addition to the BSLS_LIBRARYFEATURES_HAS_CPP17_INT_CHARCONV
macro when the native standard library also implements the std::chars_format
enumeration, and both std::from_chars
and std::to_chars
functions for all 3 standard floating point types (float
, double
, long double
). BSLS_LIBRARYFEATURES_HAS_CPP17_FILESYSTEM
macro is defined if the native standard library provides the <filesystem> header and implements all required content with no major issues. BSLS_LIBRARYFEATURES_HAS_CPP20_VERSION
macro is defined if the native standard library provides the <version> header and implements all required content with no major issues. BSLS_LIBRARYFEATURES
macros should be based on the standard feature test macro when it is appropriate. See the "STANDARD FEATURE-DETECTION MACROS" section below. BSLS_LIBRARYFEATURES_HAS_CPP20_BARRIER
macro is defined if the native standard library provides the <barrier> header and implements all required content with no major issues. __cpp_lib_barrier
feature-test macro is defined. BSLS_LIBRARYFEATURES_HAS_CPP20_LATCH
macro is defined if the native standard library provides the <latch> header and implements all required content with no major issues. __cpp_lib_latch
feature-test macro is defined. BSLS_LIBRARYFEATURES_HAS_CPP20_RANGES
macro is defined if the native standard library provides the <ranges> header and implements all required content with no major issues. __cpp_lib_ranges
feature-test macro is defined. BSLS_LIBRARYFEATURES_HAS_CPP20_SEMAPHORE
macro is defined if the native standard library provides the <semaphore> header and implements all required content with no major issues. __cpp_lib_semaphore
feature-test macro is defined. BSLS_LIBRARYFEATURES_HAS_CPP20_STOP_TOKEN
macro is defined if the native standard library provides the <stop_token> header and implements all required content with no major issues. __cpp_lib_jthread
feature-test macro is defined. BSLS_LIBRARYFEATURES_STDCPP_GNU
macro is defined if the C++ standard library implementation is GNU libstdc++. BSLS_LIBRARYFEATURES_STDCPP_IBM
macro is defined if the C++ standard library implementation is IBM's VACPP. BSLS_LIBRARYFEATURES_STDCPP_INTELLISENSE
macro is defined if Microsoft's Intellisense is running (instead of a production compiler). Note that detecting Intellisense does not mean that the MSVC compiler is used. Visual Studio 2017 is capable of cross platform development using clang and Visual Studio Code (also featuring Intellisense) may be used with virtually any compiler. BSLS_LIBRARYFEATURES_STDCPP_LLVM_LIBCPP
macro is defined if the C++ standard library implementation is LLVM's libc++. BSLS_LIBRARYFEATURES_STDCPP_MSVC
macro is defined if the C++ standard library implementation is Microsoft's (Dinkumware based) implementation. BSLS_LIBRARYFEATURES_STDCPP_LIBCSTD
macro is defined if the C++ standard library implementation is a RogueWave implementation. BSLS_LIBRARYFEATURES_STDCPP_STLPORT
macro is defined if the C++ standard library implementation is an STLPort implementation. tuple
-type is not available in older versions of the native standard library. Suppose we have a utility component that returns an instance of a tuple
of values if the underlying version of the standard library provides that type, and yet remain compilable otherwise. std::tuple
. #if defined(BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE) # ifndef INCLUDED_TUPLE # include <tuple> # define INCLUDED_TUPLE # endif #endif // BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE
struct MyStatisticalUtil { static double mean(const int *begin, const int *end); static int median(const int *begin, const int *end); static double variance(const int *begin, const int *end); // Return the median (mean, variance) of the sequence of values in // the specified non-empty, semi-open range '[begin, end)'. The // behavior is undefined unless 'begin < end'.
bsl::type
, if that type is available. Note that, if all three values are needed, calling this interface is more efficient than calling the earlier three individually because the input need be traversed one time, not three. #ifdef BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE static std::tuple<int, double, double> getMedianMeanVariance( const int *begin, const int *end); // Return the median, mean, and variance (in that order) of the // sequence of values in the specified non-empty, semi-open range // '[begin, end)'. The behavior is undefined unless 'begin < end'. #endif // BSLS_LIBRARYFEATURES_HAS_CPP11_TUPLE };
tuple
type, and those that do not. Of course, in the later case the interface that returns const char* bsls_libraryfeatures_CPP17_ABI |