Preprocessor Macros#
icubaby defines a number of preprocessor macros. They are all used as a means of discovering support for compiler and standard library features or for simplifying their use in a backwards-compatible fashion. In general, preprocessor macros are avoided if there is a way to implement the behavior within the C++ language itself.
-
ICUBABY_CXX20#
ICUBABY_CXX20 has value 1 when compiling with C++ 20 or later and 0 otherwise.
-
ICUBABY_CPP_LIB_RANGES_DEFINED#
Defined as 1 if the standard library’s __cpp_lib_ranges macro is available and 0 otherwise.
-
ICUBABY_HAVE_RANGES#
Tests for the availability of library support for C++ 20 ranges.
-
ICUBABY_CPP_CONCEPTS_DEFINED#
Defined as true if compiler and library support for concepts are available.
-
ICUBABY_CPP_LIB_CONCEPTS_DEFINED#
Defined as 1 if the standard library’s __cpp_lib_concepts macro is available and 0 otherwise.
-
ICUBABY_HAVE_CONCEPTS#
A macro that evaluates true if the compiler and library have support for C++ 20 concepts.
-
ICUBABY_REQUIRES(x)#
Defined as
requires x
if C++ 20 concepts are supported and as nothing otherwise.
-
ICUBABY_CONCEPT_OUTPUT_ITERATOR(x)#
Defined as
std::output_iterator<x>
if C++ 20 concepts are supported and astypename
otherwise.Used as a shortcut to restrict a specific template argument to be an output iterator in C++ 20 and simply declaring a typename in C++ 17.
-
ICUBABY_CONCEPT_UNICODE_CHAR_TYPE#
A convenience macro for defining a template argument that must be icubaby::unicode_char_type.
-
ICUBABY_NO_UNIQUE_ADDRESS#
Defined as
[[no_unique_address]]
if the attribute is supported and as nothing otherwise.