default_delete
and removed unique_ptr
template argument changes._Exit
.shuffle_order_engine
and knuth_b
, as they are usually implemented with floating point.identity
.<contract>
and <concepts>
.shift_left
and shift_right
algorithms.mbstate_t
and wint_t
for char_traits
.atoi
because of reliance on isspace
.visit
and bad_variant_access
.bitset
, minus the string members and throwing members.<version>
and moved the feature macro there.unique_ptr
. Leaving make_unique
and default_delete
out.<span>
.days
, weeks
, months
, and years
time durations.<csetjmp>
.static_assert
s to allocation functions in freestanding mode.unique_ptr
is no longer included in freestanding, with the hopes that unique_resource
and scope_exit
will fill the void<random>
, and white-lists inclusions rather than black-lists omissions.<compare>
, as it seems to have been accidentally omitted from the freestanding headers list.<chrono>
, <optional>
, and <variant>
.The current definition of the freestanding implementation is not very useful. Here is the current high level definition from [intro.compliance]:
Two kinds of implementations are defined: a hosted implementation and a freestanding implementation.For a hosted implementation, this document defines the set of available libraries.
The main people served by the current freestanding definition are people writing their own hosted C++ standard library to sit atop the compiler author's freestanding implementation (i.e. the STLport use case). The freestanding portions contain all the functions and types known to the compiler that can't easily be authored in a cross-compiler manner.
The current set of freestanding libraries provides too little to kernel, micro-controller, and GPU programmers. Why should a systems programmer need to rewrite std::sort()
or std::memcpy()
?
I propose we provide the (nearly) maximal subset of the library that does not require an OS or space overhead. In order to continue supporting the "layered" C++ standard library users, we will continue to provide the (nearly) minimal subset of the library needed to support all the language features, even if these features have space overhead. Language features requiring space overhead or OS support will remain intact.
Systems programmers want to sort things. They want to use move semantics. They may even want to bundle the arguments of a variadic template function into a std::tuple
. These are all reasonable things to do on a system with no operating system and kilobytes of storage. The C++ standard even has reasonable specifications for these operations in the context of a tiny, OS-less system. However, systems programmers must currently rely on either hand-rolled code or implementer extensions in order to get these facilities.
Systems programmers don't have a guide as to what C++ library facilities will work without trying them. The standard says atomic_load
will work; memcpy
will probably work; but will stable_sort
? Standardizing the subset of implementable C++ that is usable in a freestanding environment would provide clarity here, and help to educate systems programmers.
There were some presentations at recent CppCons where others made a more full featured C++ work in the Linux and Windows kernels [Quinn2016] [Baker2017]. In both of these cases, C++ was being used in a sandboxed / pseudo-virtualized way. C++ code (with exceptions and RTTI) was being run in the kernel context, but very few calls were made between the C++ code and the operating system kernel. The C++ code was in a guest operating system. This proposal should make it reasonable to have C++ code interact closely with the internals of a host operating system, perhaps in the context of a driver.
The Microsoft Windows kernel and Apple Mac OSX kernel both currently support limited, non-compliant subsets of C++ for driver writers. The Linux kernel does not support C++ officially, though with a fair amount of work on the part of the driver developer, C++ can be made to work. Drivers written in C++ are highly unlikely to be accepted in the upstream Linux source repositories.
IncludeOS [Bratterud2017] is an OS primarily intended for running in VMs, though some bare metal support has been tested. One might expect such a project to use a freestanding implementation as a base, but instead, it starts with a hosted implmentation of C++ and drops support for the impractical parts (threads and filestreams in particular).
Out of libstdc++, libc++, and Microsoft's Visual Studio STL, only libstdc++ has any relevant mention of "freestanding" or "hosted". In practice, users take a hosted implementation of C++ and use it as-is in situations where it was never intended. This means that all the headers tend to be available, but only a few of the headers actually work. Many of the headers that work aren't marked freestanding. Some headers have parts that could work, except they are mixed with other parts that won't work. For example, iterator_traits
in <iterator>
is fine, but the implementation details of the stream iterators cause build errors with the /kernel
flag in Microsoft Visual Studio 2017 15.7.
The current scope of this proposal is limited to the freestanding standard library available to micro-controller, kernel, and GPU development.
This paper is currently concerned with the divisions of headers and library functions as they were in C++17. "Standard Library Modules" (P0581) discusses how the library will be split up in a post-modules world. This paper may influence the direction of P0581, but this paper won't make any modules recommendations.
I could see the scope increasing to the availability of the standard library on GPUs.
The standard will no longer list all of the facilities available to the freestanding implementation, as is currently done in [compliance]. Instead, [compliance] will list all the headers that are required to be present, and the header and class synopses will tag which parts of the headers and classes will be available. This is a large number of small, easy to understand edits, along with the addition of a sub-clause that discusses how the tagging works.
There is precedent for this kind of tagging in other specification documents. The ECMAScript Language Specification has optional support for ECMA-402 (internationalization). The impact of ECMA-402 is called out explicitly in several places. POSIX tags functions as supported in base, XSI, or in one of many option groups.
There were some conversations in the 2017 Albuquerque meeting around adding another class of conforming implementation. I believe that such an action would be a mistake. Maintaining two classifications is difficult enough as is, and freestanding is often neglected. Adding another classification would magnify these problems. I also feel that the freestanding classification should be removed if no action is taken to make it more useful.
There was some desire to come up with a new name for "freestanding" in the 2017 Albuquerque meeting. This new name could better express the intended audience of such an implementation. My current recommendation will be to keep the name "freestanding", but I will suggest some alternatives just the same.
C++ standard library headers will likely need to add preprocessor feature toggles to portions of headers that would emit warnings or errors in freestanding mode. The precision and timeliness (compile time vs. link time) of errors remains a quality-of-implementation detail.
A minimal freestanding C11 standard library will not be sufficient to provide the C portions of the C++ standard library. std::char_traits
and many of the function specializations in <algorithm>
are implemented in terms of non-freestanding C functions. In practice, most C libraries are not minimal freestanding C11 libraries. The optimized versions of the <cstring>
and <cwchar>
functions will typically be the same for both hosted and freestanding environments.
My expectation is that no new freestanding library will be authored as a result of this paper. Instead hosted libraries will be stripped down through some feature toggle mechanism to become freestanding.
The Microsoft Visual Studio standard library implementation has taken recent steps in version 15.8 (released Aug 14, 2018) to try to better enable uses of the standard library in the kernel. From the Features and Fixes blog post
The header structure of the STL was changed to allow use of a subset of the library in conditions where the user can’t link with msvcp140.dll, such as driver development. [...] The following headers are now considered “core” and don’t inject our runtime dependencies (though we do still assume some form of CRT headers are present):
<cstddef>
<cstdlib>
<initializer_list>
<ratio>
<type_traits>
I was able to test the Microsoft Visual Studio 15.8 implementation. The C++14 parts of my additions were able to run in the Windows kernel successfully. I don't have tests for the C++17 and C++20 parts.
I had the following email discussion with Jonathan Wakely, the maintainer of libstdc++, the gcc implementation of the C++ standard library.
From: Ben CraigI had similar email discussion with Marshall Clow, the maintainer of libc++, the clang implementation of the C++ standard library.
If *someone* (possibly me) added the maze of #ifdefs to a branch of libstdc++ to support p0829, would the libstdc++ maintainers be willing to accept and maintain such a thing (assuming it is in the working draft, has tests, high quality, etc)?
From: Jonathan Wakely
Yes, definitely. If it's in the WP (and even better, useful to constrained environments) we will support it.
GCC is heavily used on bare-metal systems (especially ARM) and if those users can leverage the C++ standard library then we provide more value to them.
From: Ben Craig
[...]
If *someone* (possibly me) added the maze of #ifdefs to a branch of libc++ to support p0829, would the libc++ maintainers be willing to accept and maintain such a thing (assuming it is in the working draft, has tests, high quality, etc)? In the next draft of p0829, may I publicly state that libc++ would be willing to add that support? [...] From: Marshall Clow
I haven’t been ignoring you, but rather talking to a bunch of people who use libc++
In general, they are in favor of supporting a freestanding mode for libc++. Some of them, however, have serious concerns about p0829.
So, yes, you can put my name on the list, but I suspect you’ll get comments about the specifics.
Even more so than for a hosted implementation; kernel, micro-controller, and GPU programmers do not want to pay for what they don't use. As a consequence, I am not adding features that require global storage, even if that storage is immutable.
Note that the following concerns are not revolving around execution time performance. These are generally concerns about space overhead and correctness.
This proposal doesn't remove problematic features from the language, but it does make it so that the bulk of the freestanding standard library doesn't require those features. Users that disable the problematic features (as is existing practice) will still have portable portions of the standard library at their disposal.
Note that we cannot just take the list of constexpr
functions and make those functions the freestanding subset. We also can't do the reverse, and make everything freestanding constexpr
or conditionally noexcept
. memcpy
cannot currently be made constexpr
because it must convert from cv void*
to unsigned char[]
. Several floating point functions could be made constexpr
, but would not be permitted in freestanding. constexpr
also allows allocations, which freestanding avoids.
We also cannot just take the list of everything that is conditionally noexcept
and make those functions freestanding. The "Lakos Rule"[Meredith11] prohibits most standard library functions from being conditionally noexcept
, unless they have a wide contract.
Regardless, if a function or class is constexpr
or noexcept
, and it doesn't involve floating point, then that function or class is a strong candidate to be put into freestanding mode.
In the future, it may make sense to allow all constexpr
functions into freestanding, so long as they are used in a constexpr
context and not invoked at runtime.
Exceptions either require external jump tables or extra bookkeeping instructions. This consumes program storage space.
In the Itanium ABI, throwing an exception requires a heap allocation. In the Microsoft ABI, re-throwing an exception will consume surprisingly large amounts of stack space (2,100 bytes for a re-throw in 32-bit environments, 9,700 bytes in a 64-bit environment). Program storage space, heap space, and stack space are typically scarce resources in micro-controller development.
In environments with threads, exception handling requires the use of thread-local storage.
operator new
to make this decision.
Many micro-controller systems don't have floating point hardware. Software emulated floating point can drag in large runtimes that are difficult to optimize away.
Most operating systems speed up system calls by not saving and restoring floating point state. That means that kernel uses of floating point operations require extra care to avoid corrupting user state.
<algorithms>
, <numeric>
, and <memory>
headers, we would only be able to support sequential execution of parallel algorithms. Since this adds little value, the execution policy overloads will be omitted.
Some classes are only partially freestanding. In the Albuquerque 2017 meeting, there was no consensus on allowing or prohibiting this (SF F N A SA 0 9 3 5 1).
In this proposal, I partially include three classes: std::array
, std::string_view
, and std::optional
. If we were designing these classes from scratch with a freestanding environment in mind, they would have the exact same layout and the exact same interface, with the exception of the excluded methods. I think it is highly unlikely that the committee would standardize a std::freestanding_array
that was the exact same as std::array
, just without the at()
method.
I would like to call out std::variant
as well. While I do include the entire class, I do exclude the get()
function. get()
is logically part of the interface. The same general argument I used for std::array
, std::string_view
, and std::optional
holds for std::variant
.
- <csetjmp>
- <utility>
- <tuple>
- <ratio>
- <compare>
- <span>
- <contract>
- <ranges>
<cstdlib>
- size_t
- div_t
- ldiv_t
- lldiv_t
- NULL
- bsearch
- qsort
- abs(int)
- abs(long int)
- abs(long long int)
- labs
- llabs
- div
- ldiv
- lldiv
All the error #defines
in <cerrno>
, but not errno
.
The errc
enum from <system_error>
.
All of <optional>
, except for bad_optional_access
and optional::value
. The optional
value can be accessed through the unchecked observers, operator*
and operator->
.
All of <variant>
, except for get
. The variant
value can be accessed through get_if
.
All of <bitset>
except for operator<<; operator>>; bitset::to_string; the bitset string constructors; and the indexed versions of bitset::set, bitset::reset, and bitset::flip.
Portions of <memory>
.
pointer_traits
to_address
align
allocator_arg_t
allocator_arg
uses_allocator
allocator_traits
unique_ptr
default_delete
uses_allocator_v
Most of <functional>
. Omit the following.
std::function
and friends).boyer_moore_searcher
boyer_moore_horspool_searcher
<chrono>
durations and duration math. Omit clocks, civil time, and streaming functions.
Portions of <charconv>
.
to_chars_result
from_chars_result
to_chars
(integral)from_chars
(integral)
The char_traits
class from <string>
.
Most of <string_view>
. These functions will be omitted:
- operator<<
- basic_string_view::at
- basic_string_view::copy
- basic_string_view::substr
- basic_string_view::compare(size_type pos1, size_type n1, basic_string_view s);
- basic_string_view::compare(size_type pos1, size_type n1, basic_string_view s,
size_type pos2, size_type n2);
- basic_string_view::compare(size_type pos1, size_type n1, const charT* s);
- basic_string_view::compare(size_type pos1, size_type n1, const charT* s,
size_type n2);
Portions of <cstring>
.
- memcpy
- memmove
- strcpy
- strncpy
- strcat
- strncat
- memcmp
- strcmp
- strncmp
- memchr
- strchr
- strcspn
- strpbrk
- strrchr
- strspn
- strstr
- memset
- strlen
<cwchar>
.
- wcscpy
- wcsncpy
- wmemcpy
- wmemmove
- wcscat
- wcsncat
- wcscmp
- wcsncmp
- wmemcmp
- wcschr
- wcscspn
- wcspbrk
- wcsrchr
- wcsspn
- wcsstr
- wcstok
- wmemchr
- wcslen
- wmemset
All of <array>
except for array::at
.
All of <iterator>
except for the stream iterators.
Most of <algorithm>
and <numeric>
. The ExecutionPolicy overloads will not be included. The following functions will be omitted due to the usage of temporary buffers:
- stable_sort
- stable_partition
- inplace_merge
Portions of <random>
. The following portions will be included:
- linear_congruential_engine
- mersenne_twister_engine
- subtract_with_carry_engine
- discard_block_engine
- independent_bits_engine
knuth_b
uniform_int_distribution
<cmath>
will be present.
- abs(int)
- abs(long int)
- abs(long long int)
<cinttypes>
will be present.
- imaxabs
- imaxdiv
- abs(intmax_t)
- div(intmax_t, intmax_t)
errno
is not included as it is global state. In addition, errno is best implemented as a thread-local variable.
error_code
, error_condition
, and error_category
all have string
in the interface.
Many string functions (strtol
and family) rely on errno
.
strtok
and rand
aren't required to use thread-local storage, but good implementations do. I don't want to encourage bad implementations.
assert
is not included as it requires a stderror stream.
_Exit
is not included as I do not wish to add more termination functions. I hope to remove most of them in the future. Program termination requires involvement from the operating system / environment.
<cctype>
and <cwctype>
rely heavily on global locale data.
make_unique
is not included, although unique_ptr
is included. make_unique
has a dependency on heap management functionality, and can throw on heap exhaustion.
seed_seq
uses the heap. Users can create their own classes satisfying the seed sequence requirements if they wish to use the Sseq constructors on the engine templates.
shuffle_order_engine
doesn't have floating point in its interface, but the algorithm in the standard uses math on the real numbers, which is typically translated into code as floating point. knuth_b
is just a convenience typedef on shuffle_order_engine
. shuffle_order_engine
can be added if an efficient non-floating point implementation of the algorithm is discovered.
<cwchar>
<cwchar>
functions are implementable for freestanding environments, but infrequently used for systems programming. They do not exist in freestanding C11 implementations.
back_insert_iterator
, front_insert_iterator
, and insert_iterator
don't directly allocate memory, but their typical usage with standard containers does allocate memory. This paper doesn't add any standard containers that can be used with the insert iterators. It is also unclear how a user would signal an insertion failure. Regardless, the iterators could be used with a user's (or future standard) fixed_capacity_vector
.
visit
visit
only throws when the variant
is valueless. If exceptions are disabled, the variant
will always have a value. Since the standard doesn't acknowledge exceptions being disabled, we include the (hopefully) dead bad_variant_access
class.
unique_ptr
unique_ptr
is generally used for heap management, but is occasionally used as a makeshift RAII object for other resources. In the Jacksonville 2018 wg21 meeting, there was a strong interest in providing unique_ptr
.
default_delete
default_delete
looks like it has a dependency on the heap, due to its use of the delete
operator. default_delete
only ends up depending on the heap if the templated type would depend on the heap for new
and delete
though. A class with a custom, non-throwing operator new
and operator delete
will work just fine without pulling in the heap machinery.default_delete
also keeps us from forking the definition of unique_ptr
.
array
, bitset
, optional
, string_view
, and variant
all have functions that throw. These functions aren't critical to the use of the class. The exceptions that array
, bitset
, and string_view
throw are doubly bad, as those exceptions require std::string
. These headers and classes can be omitted if the committee strongly objects to marking a class partially freestanding.
complex<integer>
complex
class entirely, but in theory, the integer version of complex
are fine. I am unsure how many of the associated functions are implementable without floating point access though. I do not believe that complex
for integer types is a widely used class.
<cmath>
has a dependency on errno
.
errno
and string functions like strtol
errno
is global data, it isn't much global data. Thread safety is a concern for those platforms that have threading, but don't have thread-local storage.
A freestanding implementation that provides support for this paper shall define the following feature test macro.
Name | Value | Header |
---|---|---|
__cpp_freestanding_library |
201803 | <version> |
The __cpp_freestanding_library
macro is useful for detecting the absence of throwing facilities. A user could conditionally use a hand-rolled implementation in freestanding mode or the standard implementation in hosted mode.
The library feature macros have been partitioned into those that must be present in both freestanding and hosted mode, and those that only need to be present in hosted mode. If the implementation provides more than the minimal freestanding subset, then the implementation shall also provide the corresponding feature test macros.
The pre-existing feature macros were not provided on freestanding / hosted boundaries. As a result, a choice has to be made about feature test macros that contain both freestanding and non-freestanding code (e.g. __cpp_lib_chrono
, __cpp_lib_boyer_moore_searcher
, and others). This revision includes feature test macros in freestanding if any of the feature is included in freestanding. Users that need to detect the non-freestanding parts will also need to test against __cpp_freestanding_library
.
Wording is based off of an intermediate version of Working Draft, Standard for Programming Language C++, from July 26, 2018.
Add a new subclause [freestanding.membership], under [conventions] and after [objects.within.classes]:Rework Table 22 referenced from [compliance]:?.?.?.? Freestanding membership [freestanding.membership]
The freestanding implementation has several declarations and macro definitions that shall meet the same requirements as for a hosted implementation unless otherwise specified.In the associated header synopsis for such declarations and macro definitions, the items shall be followed with a comment that ends with freestanding, as in:#define E2BIG see below // freestandingThe freestanding implementation has several headers that shall meet the same requirements as for a hosted implementation unless otherwise specified.The synopsis for these headers shall start with a comment that ends with freestanding, as in:// freestanding namespace std {
Individual declarations and macro definitions in such a header shall not be followed with a comment that ends with freestanding.Some classes and class templates are required to be partially implemented in a freestanding implementation.Such entities are permitted to be fully implemented in a freestanding implementation.In the associated header synopsis for such declarations, the declarations shall be followed with a comment that ends with freestanding, partial, as in:template<class T> class optional; // freestanding, partial
Some member functions in partially implemented entities are not required to be present in a freestanding implementation.In the associated class or class template synopsis for such member functions, the declarations shall be followed by a comment that ends with freestanding, omit, as in:constexpr const T& value() const&; // freestanding, omit
All declarations in the partially implemented class or class template that are not followed by a freestanding, omit comment shall meet the same requirements as for a hosted implementation unless otherwise specified.Deduction guides for class templates that are implemented (partially or fully) in a freestanding implementation shall be implemented in a freestanding implementation.The containing namespace for each non-namespace declaration that is implemented (partially or fully) in a freestanding implementation shall be implemented in a freestanding implementation.
Subclause |
Header(s) |
|
[support.types] |
Types |
<cstddef> |
[support.limits] |
Implementation properties |
<cfloat> <limits> <climits> <version> |
[cstdint] |
Integer types |
<cstdint> |
[support.start.term] |
Start and termination |
<cstdlib> |
[support.dynamic] |
Dynamic memory management |
<new> |
[support.rtti] |
Type identification |
<typeinfo> |
[support.exception] |
Exception handling |
<exception> |
[support.initlist] |
Initializer lists |
<initializer_list> |
[support.runtime] |
Other runtime support |
<cstdarg> |
[concepts] |
Concepts library |
<concepts> |
[meta] |
Type traits |
<type_traits> |
[bit] |
Bit manipulation |
<bit> |
[atomics] |
Atomics |
<atomic> |
<algorithm> |
<cmath> |
<exception> |
<ratio> |
<array> |
<compare> |
<functional> |
<span> |
<atomic> |
<concepts> |
<initializer_list> |
<string> |
<bit> |
<contract> |
<iterator> |
<string_view> |
<bitset> |
<csetjmp> |
<limits> |
<system_error> |
<cerrno> |
<cstdarg> |
<memory> |
<tuple> |
<cfloat> |
<cstddef> |
<new> |
<type_traits> |
<charconv> |
<cstdint> |
<numeric> |
<typeinfo> |
<chrono> |
<cstdlib> |
<optional> |
<utility> |
<cinttypes> |
<cstring> |
<random> |
<variant> |
<climits> |
<cwchar> |
<ranges> |
<version> |
Instructions to the editor:The supplied version of the header <cstdlib> shall declare at least the functions abort, atexit, at_quick_exit, exit, and quick_exit [support.start.term].The other headers listed in this table shall meet the same requirements as for a hosted implementation.The supplied versions of the header <version> shall meet the requirements specified in [support.limits.general].The other headers listed in this table shall meet the requirements for a freestanding implementation, as specified in the respective header synopsis.
Replace paragraph 3 in [support.limits.general]:??? Header <cstdlib> synopsis [cstdlib.syn]
namespace std { using size_t = see below; // freestanding using div_t = see below; // freestanding using ldiv_t = see below; // freestanding using lldiv_t = see below; // freestanding } #define NULL see below // freestanding #define EXIT_FAILURE see below #define EXIT_SUCCESS see below #define RAND_MAX see below #define MB_CUR_MAX see below namespace std { // Exposition-only function type aliases extern "C" using c-atexit-handler = void(); // exposition only extern "C++" using atexit-handler = void(); // exposition only extern "C" using c-compare-pred = int(const void*, const void*); // exposition only extern "C++" using compare-pred = int(const void*, const void*); // exposition only // [support.start.term], start and termination [[noreturn]] void abort() noexcept; // freestanding int atexit(c-atexit-handler* func) noexcept; // freestanding int atexit(atexit-handler* func) noexcept; // freestanding int at_quick_exit(c-atexit-handler* func) noexcept; // freestanding int at_quick_exit(atexit-handler* func) noexcept; // freestanding [[noreturn]] void exit(int status); // freestanding [[noreturn]] void _Exit(int status) noexcept; [[noreturn]] void quick_exit(int status) noexcept; // freestanding char* getenv(const char* name); int system(const char* string); // [c.malloc], C library memory allocation void* aligned_alloc(size_t alignment, size_t size); void* calloc(size_t nmemb, size_t size); void free(void* ptr); void* malloc(size_t size); void* realloc(void* ptr, size_t size); double atof(const char* nptr); int atoi(const char* nptr); long int atol(const char* nptr); long long int atoll(const char* nptr); double strtod(const char* nptr, char** endptr); float strtof(const char* nptr, char** endptr); long double strtold(const char* nptr, char** endptr); long int strtol(const char* nptr, char** endptr, int base); long long int strtoll(const char* nptr, char** endptr, int base); unsigned long int strtoul(const char* nptr, char** endptr, int base); unsigned long long int strtoull(const char* nptr, char** endptr, int base); // [c.mb.wcs], multibyte / wide string and character conversion functions int mblen(const char* s, size_t n); int mbtowc(wchar_t* pwc, const char* s, size_t n); int wctomb(char* s, wchar_t wchar); size_t mbstowcs(wchar_t* pwcs, const char* s, size_t n); size_t wcstombs(char* s, const wchar_t* pwcs, size_t n); // [alg.c.library], C standard library algorithms void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, c-compare-pred* compar); // freestanding void* bsearch(const void* key, const void* base, size_t nmemb, size_t size, compare-pred* compar); // freestanding void qsort(void* base, size_t nmemb, size_t size, c-compare-pred* compar); // freestanding void qsort(void* base, size_t nmemb, size_t size, compare-pred* compar); // freestanding // [c.math.rand], low-quality random number generation int rand(); void srand(unsigned int seed); // [c.math.abs], absolute values int abs(int j); // freestanding long int abs(long int j); // freestanding long long int abs(long long int j); // freestanding float abs(float j); double abs(double j); long double abs(long double j); long int labs(long int j); // freestanding long long int llabs(long long int j); // freestanding div_t div(int numer, int denom); // freestanding ldiv_t div(long int numer, long int denom); // see [library.c], freestanding lldiv_t div(long long int numer, long long int denom); // see [library.c], freestanding ldiv_t ldiv(long int numer, long int denom); // freestanding lldiv_t lldiv(long long int numer, long long int denom); // freestanding }
Add a new paragraph to the end of [support.limits.general]:On freestanding and hosted implementations, the macros in Table ??35?? are defined after inclusion of the header <version> or one of the corresponding headers specified in the table.On hosted implementations, the macros in Table ??36?? are defined after inclusion of the header <version> or one of the corresponding headers specified in the table.The presence of the macros in Table ??36?? is implementation defined on freestanding implementations.[Note: Future versions of this International Standard might replace the values of these macros with greater values. -end note]
Split Table 36.A freestanding implementation shall define the __cpp_freestanding_library macro with the value 201803L in the <version> header.
__cpp_lib_addressof_constexpr
__cpp_lib_allocator_traits_is_always_equal
__cpp_lib_apply
__cpp_lib_array_constexpr
__cpp_lib_as_const
__cpp_lib_atomic_is_always_lock_free
__cpp_lib_atomic_ref
__cpp_lib_bind_front
__cpp_lib_bit_cast
__cpp_lib_bool_constant
__cpp_lib_boyer_moore_searcher
__cpp_lib_byte
__cpp_lib_char8_t
__cpp_lib_chrono
__cpp_lib_chrono_udls
__cpp_lib_clamp
__cpp_lib_concepts
__cpp_lib_constexpr_misc
__cpp_lib_constexpr_swap_algorithms
__cpp_lib_exchange_function
__cpp_lib_gcd_lcm
__cpp_lib_hardware_interference_size
__cpp_lib_has_unique_object_representations
__cpp_lib_integer_sequence
__cpp_lib_integral_constant_callable
__cpp_lib_invoke
__cpp_lib_is_aggregate
__cpp_lib_is_constant_evaluated
__cpp_lib_is_final
__cpp_lib_is_invocable
__cpp_lib_is_null_pointer
__cpp_lib_is_swappable
__cpp_lib_launder
__cpp_lib_logical_traits
__cpp_lib_make_from_tuple
__cpp_lib_make_reverse_iterator
__cpp_lib_nonmember_container_access
__cpp_lib_not_fn
__cpp_lib_null_iterators
__cpp_lib_optional
__cpp_lib_ranges
__cpp_lib_raw_memory_algorithms
__cpp_lib_result_of_sfinae
__cpp_lib_robust_nonmodifying_seq_ops
__cpp_lib_sample
__cpp_lib_string_view
__cpp_lib_three_way_comparison
__cpp_lib_to_chars
__cpp_lib_transformation_trait_aliases
__cpp_lib_transparent_operators
__cpp_lib_tuple_element_t
__cpp_lib_tuples_by_type
__cpp_lib_type_trait_variable_templates
__cpp_lib_uncaught_exceptions
__cpp_lib_variant
__cpp_lib_void_t
__cpp_lib_any
__cpp_lib_complex_udls
__cpp_lib_destroying_delete
__cpp_lib_enable_shared_from_this
__cpp_lib_erase_if
__cpp_lib_execution
__cpp_lib_filesystem
__cpp_lib_generic_associative_lookup
__cpp_lib_generic_unordered_lookup
__cpp_lib_hypot
__cpp_lib_incomplete_container_elements
__cpp_lib_list_remove_return_type
__cpp_lib_make_unique
__cpp_lib_map_try_emplace
__cpp_lib_math_special_functions
__cpp_lib_memory_resource
__cpp_lib_node_extract
__cpp_lib_parallel_algorithm
__cpp_lib_quoted_string_io
__cpp_lib_scoped_lock
__cpp_lib_shared_mutex
__cpp_lib_shared_ptr_arrays
__cpp_lib_shared_ptr_weak_type
__cpp_lib_shared_timed_mutex
__cpp_lib_string_udls
__cpp_lib_unordered_map_try_emplace
Change in [system_error.syn]:?.?.? Header <cerrno> synopsis [cerrno.syn]
#define errno see below #define E2BIG see below // freestanding #define EACCES see below // freestanding #define EADDRINUSE see below // freestanding #define EADDRNOTAVAIL see below // freestanding #define EAFNOSUPPORT see below // freestanding #define EAGAIN see below // freestanding #define EALREADY see below // freestanding #define EBADF see below // freestanding #define EBADMSG see below // freestanding #define EBUSY see below // freestanding #define ECANCELED see below // freestanding #define ECHILD see below // freestanding #define ECONNABORTED see below // freestanding #define ECONNREFUSED see below // freestanding #define ECONNRESET see below // freestanding #define EDEADLK see below // freestanding #define EDESTADDRREQ see below // freestanding #define EDOM see below // freestanding #define EEXIST see below // freestanding #define EFAULT see below // freestanding #define EFBIG see below // freestanding #define EHOSTUNREACH see below // freestanding #define EIDRM see below // freestanding #define EILSEQ see below // freestanding #define EINPROGRESS see below // freestanding #define EINTR see below // freestanding #define EINVAL see below // freestanding #define EIO see below // freestanding #define EISCONN see below // freestanding #define EISDIR see below // freestanding #define ELOOP see below // freestanding #define EMFILE see below // freestanding #define EMLINK see below // freestanding #define EMSGSIZE see below // freestanding #define ENAMETOOLONG see below // freestanding #define ENETDOWN see below // freestanding #define ENETRESET see below // freestanding #define ENETUNREACH see below // freestanding #define ENFILE see below // freestanding #define ENOBUFS see below // freestanding #define ENODATA see below // freestanding #define ENODEV see below // freestanding #define ENOENT see below // freestanding #define ENOEXEC see below // freestanding #define ENOLCK see below // freestanding #define ENOLINK see below // freestanding #define ENOMEM see below // freestanding #define ENOMSG see below // freestanding #define ENOPROTOOPT see below // freestanding #define ENOSPC see below // freestanding #define ENOSR see below // freestanding #define ENOSTR see below // freestanding #define ENOSYS see below // freestanding #define ENOTCONN see below // freestanding #define ENOTDIR see below // freestanding #define ENOTEMPTY see below // freestanding #define ENOTRECOVERABLE see below // freestanding #define ENOTSOCK see below // freestanding #define ENOTSUP see below // freestanding #define ENOTTY see below // freestanding #define ENXIO see below // freestanding #define EOPNOTSUPP see below // freestanding #define EOVERFLOW see below // freestanding #define EOWNERDEAD see below // freestanding #define EPERM see below // freestanding #define EPIPE see below // freestanding #define EPROTO see below // freestanding #define EPROTONOSUPPORT see below // freestanding #define EPROTOTYPE see below // freestanding #define ERANGE see below // freestanding #define EROFS see below // freestanding #define ESPIPE see below // freestanding #define ESRCH see below // freestanding #define ETIME see below // freestanding #define ETIMEDOUT see below // freestanding #define ETXTBSY see below // freestanding #define EWOULDBLOCK see below // freestanding #define EXDEV see below // freestanding
Change in [optional.syn]:?.?.? Header <system_error> synopsis [system_error.syn]
namespace std { class error_category; const error_category& generic_category() noexcept; const error_category& system_category() noexcept; class error_code; class error_condition; class system_error; template<class T> struct is_error_code_enum : public false_type {}; template<class T> struct is_error_condition_enum : public false_type {}; enum class errc { // freestanding address_family_not_supported, // EAFNOSUPPORT address_in_use, // EADDRINUSE address_not_available, // EADDRNOTAVAIL
Change in [optional.optional]?.?.? Header <optional> synopsis [optional.syn]
namespace std { // [optional.optional], class template optional template<class T> class optional; // freestanding, partial // [optional.nullopt], no-value state indicator struct nullopt_t{see below}; // freestanding inline constexpr nullopt_t nullopt(unspecified); // freestanding // [optional.bad.access], class bad_optional_access class bad_optional_access; // [optional.relops], relational operators template<class T, class U> constexpr bool operator==(const optional<T>&, const optional<U>&); // freestanding template<class T, class U> constexpr bool operator!=(const optional<T>&, const optional<U>&); // freestanding template<class T, class U> constexpr bool operator<(const optional<T>&, const optional<U>&); // freestanding template<class T, class U> constexpr bool operator>(const optional<T>&, const optional<U>&); // freestanding template<class T, class U> constexpr bool operator<=(const optional<T>&, const optional<U>&); // freestanding template<class T, class U> constexpr bool operator>=(const optional<T>&, const optional<U>&); // freestanding // [optional.nullops], comparison with nullopt template<class T> constexpr bool operator==(const optional<T>&, nullopt_t) noexcept; // freestanding template<class T> constexpr bool operator==(nullopt_t, const optional<T>&) noexcept; // freestanding template<class T> constexpr bool operator!=(const optional<T>&, nullopt_t) noexcept; // freestanding template<class T> constexpr bool operator!=(nullopt_t, const optional<T>&) noexcept; // freestanding template<class T> constexpr bool operator<(const optional<T>&, nullopt_t) noexcept; // freestanding template<class T> constexpr bool operator<(nullopt_t, const optional<T>&) noexcept; // freestanding template<class T> constexpr bool operator>(const optional<T>&, nullopt_t) noexcept; // freestanding template<class T> constexpr bool operator>(nullopt_t, const optional<T>&) noexcept; // freestanding template<class T> constexpr bool operator<=(const optional<T>&, nullopt_t) noexcept; // freestanding template<class T> constexpr bool operator<=(nullopt_t, const optional<T>&) noexcept; // freestanding template<class T> constexpr bool operator>=(const optional<T>&, nullopt_t) noexcept; // freestanding template<class T> constexpr bool operator>=(nullopt_t, const optional<T>&) noexcept; // freestanding // [optional.comp_with_t], comparison with T template<class T, class U> constexpr bool operator==(const optional<T>&, const U&); // freestanding template<class T, class U> constexpr bool operator==(const T&, const optional<U>&); // freestanding template<class T, class U> constexpr bool operator!=(const optional<T>&, const U&); // freestanding template<class T, class U> constexpr bool operator!=(const T&, const optional<U>&); // freestanding template<class T, class U> constexpr bool operator<(const optional<T>&, const U&); // freestanding template<class T, class U> constexpr bool operator<(const T&, const optional<U>&); // freestanding template<class T, class U> constexpr bool operator>(const optional<T>&, const U&); // freestanding template<class T, class U> constexpr bool operator>(const T&, const optional<U>&); // freestanding template<class T, class U> constexpr bool operator<=(const optional<T>&, const U&); // freestanding template<class T, class U> constexpr bool operator<=(const T&, const optional<U>&); // freestanding template<class T, class U> constexpr bool operator>=(const optional<T>&, const U&); // freestanding template<class T, class U> constexpr bool operator>=(const T&, const optional<U>&); // freestanding // [optional.specalg], specialized algorithms template<class T> void swap(optional<T>&, optional<T>&) noexcept(see below); // freestanding template<class T> constexpr optional<see below> make_optional(T&&); // freestanding template<class T, class... Args> constexpr optional<T> make_optional(Args&&... args); // freestanding template<class T, class U, class... Args> constexpr optional<T> make_optional(initializer_list<U> il, Args&&... args); // freestanding // [optional.hash], hash support template<class T> struct hash; // freestanding template<class T> struct hash<optional<T>>; // freestanding }
Change in [variant.syn]:// [optional.observe], observers constexpr const T* operator->() const; constexpr T* operator->(); constexpr const T& operator*() const&; constexpr T& operator*() &; constexpr T&& operator*() &&; constexpr const T&& operator*() const&&; constexpr explicit operator bool() const noexcept; constexpr bool has_value() const noexcept; constexpr const T& value() const&; // freestanding, omit constexpr T& value() &; // freestanding, omit constexpr T&& value() &&; // freestanding, omit constexpr const T&& value() const&&; // freestanding, omit template<class U> constexpr T value_or(U&&) const&; template<class U> constexpr T value_or(U&&) &&;
Change in [bitset.syn]:?.?.? Header <variant> synopsis [variant.syn]
namespace std { // [variant.variant], class template variant template<class... Types> class variant; // freestanding // [variant.helper], variant helper classes template<class T> struct variant_size; // not defined, freestanding template<class T> struct variant_size<const T>; // freestanding template<class T> struct variant_size<volatile T>; // freestanding template<class T> struct variant_size<const volatile T>; // freestanding template<class T> inline constexpr size_t variant_size_v = variant_size<T>::value; // freestanding template<class... Types> struct variant_size<variant<Types...>>; // freestanding template<size_t I, class T> struct variant_alternative; // not defined, freestanding template<size_t I, class T> struct variant_alternative<I, const T>; // freestanding template<size_t I, class T> struct variant_alternative<I, volatile T>; // freestanding template<size_t I, class T> struct variant_alternative<I, const volatile T>; // freestanding template<size_t I, class T> using variant_alternative_t = typename variant_alternative<I, T>::type; // freestanding template<size_t I, class... Types> struct variant_alternative<I, variant<Types...>>; // freestanding inline constexpr size_t variant_npos = -1; // freestanding // [value.get], value access template<class T, class... Types> // freestanding constexpr bool holds_alternative(const variant<Types...>&) noexcept; template<size_t I, class... Types> // freestanding constexpr variant_alternative_t<I, variant<Types...>>& get(variant<Types...>&); template<size_t I, class... Types> // freestanding constexpr variant_alternative_t<I, variant<Types...>>&& get(variant<Types...>&&); template<size_t I, class... Types> // freestanding constexpr const variant_alternative_t<I, variant<Types...>>& get(const variant<Types...>&); template<size_t I, class... Types> // freestanding constexpr const variant_alternative_t<I, variant<Types...>>&& get(const variant<Types...>&&); template<class T, class... Types> constexpr T& get(variant<Types...>&); template<class T, class... Types> constexpr T&& get(variant<Types...>&&); template<class T, class... Types> constexpr const T& get(const variant<Types...>&); template<class T, class... Types> constexpr const T&& get(const variant<Types...>&&); template<size_t I, class... Types> constexpr add_pointer_t<variant_alternative_t<I, variant<Types...>>> get_if(variant<Types...>*) noexcept; // freestanding template<size_t I, class... Types> constexpr add_pointer_t<const variant_alternative_t<I, variant<Types...>>> get_if(const variant<Types...>*) noexcept; // freestanding template<class T, class... Types> constexpr add_pointer_t<T> get_if(variant<Types...>*) noexcept; // freestanding template<class T, class... Types> constexpr add_pointer_t<const T> get_if(const variant<Types...>*) noexcept; // freestanding // [variant.relops], relational operators template<class... Types> // freestanding constexpr bool operator==(const variant<Types...>&, const variant<Types...>&); template<class... Types> // freestanding constexpr bool operator!=(const variant<Types...>&, const variant<Types...>&); template<class... Types> // freestanding constexpr bool operator<(const variant<Types...>&, const variant<Types...>&); template<class... Types> // freestanding constexpr bool operator>(const variant<Types...>&, const variant<Types...>&); template<class... Types> // freestanding constexpr bool operator<=(const variant<Types...>&, const variant<Types...>&); template<class... Types> // freestanding constexpr bool operator>=(const variant<Types...>&, const variant<Types...>&); // [variant.visit], visitation template<class Visitor, class... Variants> constexpr see below visit(Visitor&&, Variants&&...); // freestanding template<class R, class Visitor, class... Variants> constexpr R visit(Visitor&&, Variants&&...); // freestanding // [variant.monostate], class monostate struct monostate; // freestanding // [variant.monostate.relops], monostate relational operators constexpr bool operator==(monostate, monostate) noexcept; // freestanding constexpr bool operator!=(monostate, monostate) noexcept; // freestanding constexpr bool operator<(monostate, monostate) noexcept; // freestanding constexpr bool operator>(monostate, monostate) noexcept; // freestanding constexpr bool operator<=(monostate, monostate) noexcept; // freestanding constexpr bool operator>=(monostate, monostate) noexcept; // freestanding // [variant.specalg], specialized algorithms template<class... Types> // freestanding void swap(variant<Types...>&, variant<Types...>&) noexcept(see below); // [variant.bad.access], class bad_variant_access class bad_variant_access; // freestanding // [variant.hash], hash support template<class T> struct hash; // freestanding template<class... Types> struct hash<variant<Types...>>; // freestanding template<> struct hash<monostate>; // freestanding }
Change in [template.bitset]:?.?.? Header <bitset> synopsis [bitset.syn]
#include <string> #include <iosfwd> // for istream, ostream, see [iosfwd.syn] namespace std { template<size_t N> class bitset; // freestanding, partial // [bitset.operators], bitset operators template<size_t N> // freestanding bitset<N> operator&(const bitset<N>&, const bitset<N>&) noexcept; template<size_t N> // freestanding bitset<N> operator|(const bitset<N>&, const bitset<N>&) noexcept; template<size_t N> // freestanding bitset<N> operator^(const bitset<N>&, const bitset<N>&) noexcept; template<class charT, class traits, size_t N> basic_istream<charT, traits>& operator>>(basic_istream<charT, traits>& is, bitset<N>& x); template<class charT, class traits, size_t N> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const bitset<N>& x); }
Change in [memory.syn]:?.?.? Class template bitset [template.bitset]
namespace std { template<size_t N> class bitset { public: // bit reference class reference { friend class bitset; reference() noexcept; public: reference(const reference&) = default; ~reference(); reference& operator=(bool x) noexcept; // for b[i] = x; reference& operator=(const reference&) noexcept; // for b[i] = b[j]; bool operator~() const noexcept; // flips the bit operator bool() const noexcept; // for x = b[i]; reference& flip() noexcept; // for b[i].flip(); }; // [bitset.cons], constructors constexpr bitset() noexcept; constexpr bitset(unsigned long long val) noexcept; template<class charT, class traits, class Allocator> explicit bitset( const basic_string<charT, traits, Allocator>& str, typename basic_string<charT, traits, Allocator>::size_type pos = 0, typename basic_string<charT, traits, Allocator>::size_type n = basic_string<charT, traits, Allocator>::npos, charT zero = charT('0'), charT one = charT('1')); // freestanding, omit template<class charT> explicit bitset( const charT* str, typename basic_string<charT>::size_type n = basic_string<charT>::npos, charT zero = charT('0'), charT one = charT('1')); // freestanding, omit // [bitset.members], bitset operations bitset<N>& operator&=(const bitset<N>& rhs) noexcept; bitset<N>& operator|=(const bitset<N>& rhs) noexcept; bitset<N>& operator^=(const bitset<N>& rhs) noexcept; bitset<N>& operator<<=(size_t pos) noexcept; bitset<N>& operator>>=(size_t pos) noexcept; bitset<N>& set() noexcept; bitset<N>& set(size_t pos, bool val = true); // freestanding, omit bitset<N>& reset() noexcept; bitset<N>& reset(size_t pos); // freestanding, omit bitset<N> operator~() const noexcept; bitset<N>& flip() noexcept; bitset<N>& flip(size_t pos); // freestanding, omit // element access constexpr bool operator[](size_t pos) const; // for b[i]; reference operator[](size_t pos); // for b[i]; unsigned long to_ulong() const; unsigned long long to_ullong() const; template<class charT = char, class traits = char_traits<charT>, class Allocator = allocator<charT>> basic_string<charT, traits, Allocator> to_string(charT zero = charT('0'), charT one = charT('1')) const; // freestanding, omit size_t count() const noexcept; constexpr size_t size() const noexcept; bool operator==(const bitset<N>& rhs) const noexcept; bool operator!=(const bitset<N>& rhs) const noexcept; bool test(size_t pos) const; bool all() const noexcept; bool any() const noexcept; bool none() const noexcept; bitset<N> operator<<(size_t pos) const noexcept; bitset<N> operator>>(size_t pos) const noexcept; }; // [bitset.hash], hash support template<class T> struct hash; template<size_t N> struct hash<bitset<N>>; }
Change in [functional.syn]:?.?.? Header <memory> synopsis [memory.syn]
The header <memory> defines several types and function templates that describe properties of pointers and pointer-like types, manage memory for containers and other template types, destroy objects, and construct multiple objects in uninitialized memory buffers ([pointer.traits]-[specialized.algorithms]).The header also defines the templates unique_ptr, shared_ptr, weak_ptr, and various function templates that operate on objects of these types ([smartptr]).namespace std { // [pointer.traits], pointer traits template<class Ptr> struct pointer_traits; // freestanding template<class T> struct pointer_traits<T*>; // freestanding // [pointer.conversion], pointer conversion template<class Ptr> auto to_address(const Ptr& p) noexcept; // freestanding template<class T> constexpr T* to_address(T* p) noexcept; // freestanding // [util.dynamic.safety], pointer safety enum class pointer_safety { relaxed, preferred, strict }; void declare_reachable(void* p); template<class T> T* undeclare_reachable(T* p); void declare_no_pointers(char* p, size_t n); void undeclare_no_pointers(char* p, size_t n); pointer_safety get_pointer_safety() noexcept; // [ptr.align], pointer alignment void* align(size_t alignment, size_t size, void*& ptr, size_t& space); // freestanding template<size_t N, class T> [[nodiscard]] constexpr T* assume_aligned(T* ptr);// freestanding // [allocator.tag], allocator argument tag struct allocator_arg_t { explicit allocator_arg_t() = default; }; // freestanding inline constexpr allocator_arg_t allocator_arg{}; // freestanding // [allocator.uses], uses_allocator template<class T, class Alloc> struct uses_allocator; // freestanding // [allocator.uses.trait], uses_allocator template<class T, class Alloc> inline constexpr bool uses_allocator_v = uses_allocator<T, Alloc>::value; // freestanding // [allocator.uses.construction], uses-allocator construction template <class T, class Alloc, class... Args> auto uses_allocator_construction_args(const Alloc& alloc, Args&&... args) -> see below; template <class T, class Alloc, class Tuple1, class Tuple2> auto uses_allocator_construction_args(const Alloc& alloc, piecewise_construct_t, Tuple1&& x, Tuple2&& y) -> see below; template <class T, class Alloc> auto uses_allocator_construction_args(const Alloc& alloc) -> see below; template <class T, class Alloc, class U, class V> auto uses_allocator_construction_args(const Alloc& alloc, U&& u, V&& v) -> see below; template <class T, class Alloc, class U, class V> auto uses_allocator_construction_args(const Alloc& alloc, const pair<U,V>& pr) -> see below; template <class T, class Alloc, class U, class V> auto uses_allocator_construction_args(const Alloc& alloc, pair<U,V>&& pr) -> see below; template <class T, class Alloc, class... Args> T make_obj_using_allocator(const Alloc& alloc, Args&&... args); template <class T, class Alloc, class... Args> T* uninitialized_construct_using_allocator(T* p, const Alloc& alloc, Args&&... args); // [allocator.traits], allocator traits template<class Alloc> struct allocator_traits; // freestanding // [default.allocator], the default allocator template<class T> class allocator; template<class T, class U> bool operator==(const allocator<T>&, const allocator<U>&) noexcept; template<class T, class U> bool operator!=(const allocator<T>&, const allocator<U>&) noexcept; // [specialized.algorithms], specialized algorithms // [special.mem.concepts], special memory concepts template<class I> concept no-throw-input-iterator = see below; // exposition only template<class I> concept no-throw-forward-iterator = see below; // exposition only template<class S, class I> concept no-throw-sentinel = see below; // exposition only template<class R> concept no-throw-input-range = see below; // exposition only template<class R> concept no-throw-forward-range = see below; // exposition only template<class T> constexpr T* addressof(T& r) noexcept; // freestanding template<class T> const T* addressof(const T&&) = delete; // freestanding template<class ForwardIterator> void uninitialized_default_construct(ForwardIterator first, ForwardIterator last); // freestanding template<class ExecutionPolicy, class ForwardIterator> void uninitialized_default_construct(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] ForwardIterator first, ForwardIterator last); template<class ForwardIterator, class Size> ForwardIterator uninitialized_default_construct_n(ForwardIterator first, Size n); // freestanding template<class ExecutionPolicy, class ForwardIterator, class Size> ForwardIterator uninitialized_default_construct_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] ForwardIterator first, Size n); namespace ranges { template<no-throw-forward-iterator I, no-throw-sentinel<I> S> requires DefaultConstructible<iter_value_t<I>> I uninitialized_default_construct(I first, S last); // freestanding template<no-throw-forward-range R> requires DefaultConstructible<iter_value_t<iterator_t<R>>> safe_iterator_t<R> uninitialized_default_construct(R&& r); // freestanding template<no-throw-forward-iterator I> requires DefaultConstructible<iter_value_t<I>> I uninitialized_default_construct_n(I first, iter_difference_t<I> n); // freestanding } template<class ForwardIterator> void uninitialized_value_construct(ForwardIterator first, ForwardIterator last); // freestanding template<class ExecutionPolicy, class ForwardIterator> void uninitialized_value_construct(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] ForwardIterator first, ForwardIterator last); template<class ForwardIterator, class Size> ForwardIterator uninitialized_value_construct_n(ForwardIterator first, Size n); // freestanding template<class ExecutionPolicy, class ForwardIterator, class Size> ForwardIterator uninitialized_value_construct_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] ForwardIterator first, Size n); namespace ranges { template<no-throw-forward-iterator I, no-throw-sentinel<I> S> requires DefaultConstructible<iter_value_t<I>> I uninitialized_value_construct(I first, S last); // freestanding template<no-throw-forward-range R> requires DefaultConstructible<iter_value_t<iterator_t<R>>> safe_iterator_t<R> uninitialized_value_construct(R&& r); // freestanding template<no-throw-forward-iterator I> requires DefaultConstructible<iter_value_t<I>> I uninitialized_value_construct_n(I first, iter_difference_t<I> n); // freestanding } template<class InputIterator, class ForwardIterator> ForwardIterator uninitialized_copy(InputIterator first, InputIterator last, ForwardIterator result); // freestanding template<class ExecutionPolicy, class InputIterator, class ForwardIterator> ForwardIterator uninitialized_copy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] InputIterator first, InputIterator last, ForwardIterator result); template<class InputIterator, class Size, class ForwardIterator> ForwardIterator uninitialized_copy_n(InputIterator first, Size n, ForwardIterator result); // freestanding template<class ExecutionPolicy, class InputIterator, class Size, class ForwardIterator> ForwardIterator uninitialized_copy_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] InputIterator first, Size n, ForwardIterator result); namespace ranges { template<class I, class O> using uninitialized_copy_result = copy_result<I, O>; // freestanding template<InputIterator I, Sentinel<I> S1, no-throw-forward-iterator O, no-throw-sentinel<O> S2> requires Constructible<iter_value_t<O>, iter_reference_t<I>> uninitialized_copy_result<I, O> uninitialized_copy(I ifirst, S1 ilast, O ofirst, S2 olast); // freestanding template<InputRange IR, no-throw-forward-range OR> requires Constructible<iter_value_t<iterator_t<OR>>, iter_reference_t<iterator_t<IR>>> uninitialized_copy_result<safe_iterator_t<IR>, safe_iterator_t<OR>> uninitialized_copy(IR&& input_range, OR&& output_range); // freestanding template<class I, class O> using uninitialized_copy_n_result = uninitialized_copy_result<I, O>; // freestanding template<InputIterator I, no-throw-forward-iterator O, no-throw-sentinel<O> S> requires Constructible<iter_value_t<O>, iter_reference_t<I>> uninitialized_copy_n_result<I, O> uninitialized_copy_n(I ifirst, iter_difference_t<I> n, O ofirst, S olast); // freestanding } template<class InputIterator, class ForwardIterator> ForwardIterator uninitialized_move(InputIterator first, InputIterator last, ForwardIterator result); // freestanding template<class ExecutionPolicy, class InputIterator, class ForwardIterator> ForwardIterator uninitialized_move(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] InputIterator first, InputIterator last, ForwardIterator result); template<class InputIterator, class Size, class ForwardIterator> pair<InputIterator, ForwardIterator> uninitialized_move_n(InputIterator first, Size n, ForwardIterator result); // freestanding template<class ExecutionPolicy, class InputIterator, class Size, class ForwardIterator> pair<InputIterator, ForwardIterator> uninitialized_move_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] InputIterator first, Size n, ForwardIterator result); namespace ranges { template<class I, class O> using uninitialized_move_result = uninitialized_copy_result<I, O>; // freestanding template<InputIterator I, Sentinel<I> S1, no-throw-forward-iterator O, no-throw-sentinel<O> S2> requires Constructible<iter_value_t<O>, iter_rvalue_reference_t<I>> uninitialized_move_result<I, O> uninitialized_move(I ifirst, S1 ilast, O ofirst, S2 olast); // freestanding template<InputRange IR, no-throw-forward-range OR> requires Constructible<iter_value_t<iterator_t<OR>>, iter_rvalue_reference_t<iterator_t<IR>>> uninitialized_move_result<safe_iterator_t<IR>, safe_iterator_t<OR>> uninitialized_move(IR&& input_range, OR&& output_range); // freestanding template<class I, class O> using uninitialized_move_n_result = uninitialized_copy_result<I, O>; // freestanding template<InputIterator I, no-throw-forward-iterator O, no-throw-sentinel<O> S> requires Constructible<iter_value_t<O>, iter_rvalue_reference_t<I>> uninitialized_move_n_result<I, O> uninitialized_move_n(I ifirst, iter_difference_t<I> n, O ofirst, S olast); // freestanding } template<class ForwardIterator, class T> void uninitialized_fill(ForwardIterator first, ForwardIterator last, const T& x); // freestanding template<class ExecutionPolicy, class ForwardIterator, class T> void uninitialized_fill(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] ForwardIterator first, ForwardIterator last, const T& x); template<class ForwardIterator, class Size, class T> ForwardIterator uninitialized_fill_n(ForwardIterator first, Size n, const T& x); // freestanding template<class ExecutionPolicy, class ForwardIterator, class Size, class T> ForwardIterator uninitialized_fill_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] ForwardIterator first, Size n, const T& x); namespace ranges { template<no-throw-forward-iterator I, no-throw-sentinel<I> S, class T> requires Constructible<iter_value_t<I>, const T&> I uninitialized_fill(I first, S last, const T& x); // freestanding template<no-throw-forward-range R, class T> requires Constructible<iter_value_t<iterator_t<R>>, const T&> safe_iterator_t<R> uninitialized_fill(R&& r, const T& x); // freestanding template<no-throw-forward-iterator I, class T> requires Constructible<iter_value_t<I>, const T&> I uninitialized_fill_n(I first, iter_difference_t<I> n, const T& x); // freestanding } template<class T> void destroy_at(T* location); // freestanding template<class ForwardIterator> void destroy(ForwardIterator first, ForwardIterator last); // freestanding template<class ExecutionPolicy, class ForwardIterator> void destroy(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] ForwardIterator first, ForwardIterator last); template<class ForwardIterator, class Size> ForwardIterator destroy_n(ForwardIterator first, Size n); // freestanding template<class ExecutionPolicy, class ForwardIterator, class Size> ForwardIterator destroy_n(ExecutionPolicy&& exec, // see [algorithms.parallel.overloads] ForwardIterator first, Size n); namespace ranges { template<Destructible T> void destroy_at(T* location) noexcept; // freestanding template<no-throw-input-iterator I, no-throw-sentinel<I> S> requires Destructible<iter_value_t<I>> I destroy(I first, S last) noexcept; // freestanding template<no-throw-input-range R> requires Destructible<iter_value_t<iterator_t<R>> safe_iterator_t<R> destroy(R&& r) noexcept; // freestanding template<no-throw-input-iterator I> requires Destructible<iter_value_t<I>> I destroy_n(I first, iter_difference_t<I> n) noexcept; // freestanding } // [unique.ptr], class template unique_ptr template<class T> struct default_delete; // freestanding template<class T> struct default_delete<T[]>; // freestanding template<class T, class D = default_delete<T>> class unique_ptr; // freestanding template<class T, class D> class unique_ptr<T[], D>; // freestanding template<class T, class... Args> unique_ptr<T> make_unique(Args&&... args); // T is not array template<class T> unique_ptr<T> make_unique(size_t n); // T is U[] template<class T, class... Args> unspecified make_unique(Args&&...) = delete; // T is U[N] template<class T> unique_ptr<T> make_unique_default_init(); // T is not array template<class T> unique_ptr<T> make_unique_default_init(size_t n); // T is U[] template<class T, class... Args> unspecified make_unique_default_init(Args&&...) = delete; // T is U[N] template<class T, class D> // freestanding void swap(unique_ptr<T, D>& x, unique_ptr<T, D>& y) noexcept; template<class T1, class D1, class T2, class D2> // freestanding bool operator==(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); template<class T1, class D1, class T2, class D2> // freestanding bool operator!=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); template<class T1, class D1, class T2, class D2> // freestanding bool operator<(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); template<class T1, class D1, class T2, class D2> // freestanding bool operator>(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); template<class T1, class D1, class T2, class D2> // freestanding bool operator<=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); template<class T1, class D1, class T2, class D2> // freestanding bool operator>=(const unique_ptr<T1, D1>& x, const unique_ptr<T2, D2>& y); template<class T, class D> // freestanding bool operator==(const unique_ptr<T, D>& x, nullptr_t) noexcept; template<class T, class D> // freestanding bool operator==(nullptr_t, const unique_ptr<T, D>& y) noexcept; template<class T, class D> // freestanding bool operator!=(const unique_ptr<T, D>& x, nullptr_t) noexcept; template<class T, class D> // freestanding bool operator!=(nullptr_t, const unique_ptr<T, D>& y) noexcept; template<class T, class D> // freestanding bool operator<(const unique_ptr<T, D>& x, nullptr_t); template<class T, class D> // freestanding bool operator<(nullptr_t, const unique_ptr<T, D>& y); template<class T, class D> // freestanding bool operator>(const unique_ptr<T, D>& x, nullptr_t); template<class T, class D> // freestanding bool operator>(nullptr_t, const unique_ptr<T, D>& y); template<class T, class D> // freestanding bool operator<=(const unique_ptr<T, D>& x, nullptr_t); template<class T, class D> // freestanding bool operator<=(nullptr_t, const unique_ptr<T, D>& y); template<class T, class D> // freestanding bool operator>=(const unique_ptr<T, D>& x, nullptr_t); template<class T, class D> // freestanding bool operator>=(nullptr_t, const unique_ptr<T, D>& y); template<class E, class T, class Y, class D> basic_ostream<E, T>& operator<<(basic_ostream<E, T>& os, const unique_ptr<Y, D>& p); // [util.smartptr.weak.bad], class bad_weak_ptr class bad_weak_ptr; // [util.smartptr.shared], class template shared_ptr template<class T> class shared_ptr; // [util.smartptr.shared.create], shared_ptr creation template<class T, class... Args> shared_ptr<T> make_shared(Args&&... args); // T is not array template<class T, class A, class... Args> shared_ptr<T> allocate_shared(const A& a, Args&&... args); // T is not array template<class T> shared_ptr<T> make_shared(size_t N); // T is U[] template<class T, class A> shared_ptr<T> allocate_shared(const A& a, size_t N); // T is U[] template<class T> shared_ptr<T> make_shared(); // T is U[N] template<class T, class A> shared_ptr<T> allocate_shared(const A& a); // T is U[N] template<class T> shared_ptr<T> make_shared(size_t N, const remove_extent_t<T>& u); // T is U[] template<class T, class A> shared_ptr<T> allocate_shared(const A& a, size_t N, const remove_extent_t<T>& u); // T is U[] template<class T> shared_ptr<T> make_shared(const remove_extent_t<T>& u); // T is U[N] template<class T, class A> shared_ptr<T> allocate_shared(const A& a, const remove_extent_t<T>& u); // T is U[N] template<class T> shared_ptr<T> make_shared_default_init(); // T is not U[] template<class T, class A> shared_ptr<T> allocate_shared_default_init(const A& a); // T is not U[] template<class T> shared_ptr<T> make_shared_default_init(size_t N); // T is U[] template<class T, class A> shared_ptr<T> allocate_shared_default_init(const A& a, size_t N); // T is U[] // [util.smartptr.shared.cmp], shared_ptr comparisons template<class T, class U> bool operator==(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; template<class T, class U> bool operator!=(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; template<class T, class U> bool operator<(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; template<class T, class U> bool operator>(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; template<class T, class U> bool operator<=(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; template<class T, class U> bool operator>=(const shared_ptr<T>& a, const shared_ptr<U>& b) noexcept; template<class T> bool operator==(const shared_ptr<T>& x, nullptr_t) noexcept; template<class T> bool operator==(nullptr_t, const shared_ptr<T>& y) noexcept; template<class T> bool operator!=(const shared_ptr<T>& x, nullptr_t) noexcept; template<class T> bool operator!=(nullptr_t, const shared_ptr<T>& y) noexcept; template<class T> bool operator<(const shared_ptr<T>& x, nullptr_t) noexcept; template<class T> bool operator<(nullptr_t, const shared_ptr<T>& y) noexcept; template<class T> bool operator<=(const shared_ptr<T>& x, nullptr_t) noexcept; template<class T> bool operator<=(nullptr_t, const shared_ptr<T>& y) noexcept; template<class T> bool operator>(const shared_ptr<T>& x, nullptr_t) noexcept; template<class T> bool operator>(nullptr_t, const shared_ptr<T>& y) noexcept; template<class T> bool operator>=(const shared_ptr<T>& x, nullptr_t) noexcept; template<class T> bool operator>=(nullptr_t, const shared_ptr<T>& y) noexcept; // [util.smartptr.shared.spec], shared_ptr specialized algorithms template<class T> void swap(shared_ptr<T>& a, shared_ptr<T>& b) noexcept; // [util.smartptr.shared.cast], shared_ptr casts template<class T, class U> shared_ptr<T> static_pointer_cast(const shared_ptr<U>& r) noexcept; template<class T, class U> shared_ptr<T> static_pointer_cast(shared_ptr<U>&& r) noexcept; template<class T, class U> shared_ptr<T> dynamic_pointer_cast(const shared_ptr<U>& r) noexcept; template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U>&& r) noexcept; template<class T, class U> shared_ptr<T> const_pointer_cast(const shared_ptr<U>& r) noexcept; template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U>&& r) noexcept; template<class T, class U> shared_ptr<T> reinterpret_pointer_cast(const shared_ptr<U>& r) noexcept; template<class T, class U> shared_ptr<T> reinterpret_pointer_cast(shared_ptr<U>&& r) noexcept; // [util.smartptr.getdeleter], shared_ptr get_deleter template<class D, class T> D* get_deleter(const shared_ptr<T>& p) noexcept; // [util.smartptr.shared.io], shared_ptr I/O template<class E, class T, class Y> basic_ostream<E, T>& operator<<(basic_ostream<E, T>& os, const shared_ptr<Y>& p); // [util.smartptr.weak], class template weak_ptr template<class T> class weak_ptr; // [util.smartptr.weak.spec], weak_ptr specialized algorithms template<class T> void swap(weak_ptr<T>& a, weak_ptr<T>& b) noexcept; // [util.smartptr.ownerless], class template owner_less template<class T = void> struct owner_less; // [util.smartptr.enab], class template enable_shared_from_this template<class T> class enable_shared_from_this; // [util.smartptr.hash], hash support template<class T> struct hash; // freestanding template<class T, class D> struct hash<unique_ptr<T, D>>; // freestanding template<class T> struct hash<shared_ptr<T>>; // [util.smartptr.atomic], atomic smart pointers template<class T> struct atomic<shared_ptr<T>>; template<class T> struct atomic<weak_ptr<T>>; }
Change in [charconv.syn]:?.?.? Header <functional> synopsis [functional.syn]
namespace std { // [func.invoke], invoke template<class F, class... Args> invoke_result_t<F, Args...> invoke(F&& f, Args&&... args) noexcept(is_nothrow_invocable_v<F, Args...>); // freestanding // [refwrap], reference_wrapper template<class T> class reference_wrapper; // freestanding template<class T> reference_wrapper<T> ref(T&) noexcept; // freestanding template<class T> reference_wrapper<const T> cref(const T&) noexcept; // freestanding template<class T> void ref(const T&&) = delete; // freestanding template<class T> void cref(const T&&) = delete; // freestanding template<class T> reference_wrapper<T> ref(reference_wrapper<T>) noexcept; // freestanding template<class T> reference_wrapper<const T> cref(reference_wrapper<T>) noexcept; // freestanding template<class T> struct unwrap_reference; // freestanding template<class T> struct unwrap_ref_decay : unwrap_reference<decay_t<T>> {}; // freestanding template<class T> using unwrap_ref_decay_t = typename unwrap_ref_decay<T>::type; // freestanding // [arithmetic.operations], arithmetic operations template<class T = void> struct plus; // freestanding template<class T = void> struct minus; // freestanding template<class T = void> struct multiplies; // freestanding template<class T = void> struct divides; // freestanding template<class T = void> struct modulus; // freestanding template<class T = void> struct negate; // freestanding template<> struct plus<void>; // freestanding template<> struct minus<void>; // freestanding template<> struct multiplies<void>; // freestanding template<> struct divides<void>; // freestanding template<> struct modulus<void>; // freestanding template<> struct negate<void>; // freestanding // [comparisons], comparisons template<class T = void> struct equal_to; // freestanding template<class T = void> struct not_equal_to; // freestanding template<class T = void> struct greater; // freestanding template<class T = void> struct less; // freestanding template<class T = void> struct greater_equal; // freestanding template<class T = void> struct less_equal; // freestanding template<> struct equal_to<void>; // freestanding template<> struct not_equal_to<void>; // freestanding template<> struct greater<void>; // freestanding template<> struct less<void>; // freestanding template<> struct greater_equal<void>; // freestanding template<> struct less_equal<void>; // freestanding // [logical.operations], logical operations template<class T = void> struct logical_and; // freestanding template<class T = void> struct logical_or; // freestanding template<class T = void> struct logical_not; // freestanding template<> struct logical_and<void>; // freestanding template<> struct logical_or<void>; // freestanding template<> struct logical_not<void>; // freestanding // [bitwise.operations], bitwise operations template<class T = void> struct bit_and; // freestanding template<class T = void> struct bit_or; // freestanding template<class T = void> struct bit_xor; // freestanding template<class T = void> struct bit_not; // freestanding template<> struct bit_and<void>; // freestanding template<> struct bit_or<void>; // freestanding template<> struct bit_xor<void>; // freestanding template<> struct bit_not<void>; // freestanding // [func.identity], identity struct identity; // freestanding // [func.not_fn], function template not_fn template<class F> unspecified not_fn(F&& f); // freestanding // [func.bind_front], function template bind_front template <class F, class... Args> unspecified bind_front(F&&, Args&&...); // freestanding // [func.bind], bind template<class T> struct is_bind_expression; // freestanding template<class T> struct is_placeholder; // freestanding template<class F, class... BoundArgs> unspecified bind(F&&, BoundArgs&&...); // freestanding template<class R, class F, class... BoundArgs> unspecified bind(F&&, BoundArgs&&...); // freestanding namespace placeholders { // M is the implementation-defined number of placeholders see below _1; // freestanding see below _2; // freestanding . . . see below _M; // freestanding } // [func.memfn], member function adaptors template<class R, class T> unspecified mem_fn(R T::*) noexcept; // freestanding // [func.wrap], polymorphic function wrappers class bad_function_call; template<class> class function; // not defined template<class R, class... ArgTypes> class function<R(ArgTypes...)>; template<class R, class... ArgTypes> void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&) noexcept; template<class R, class... ArgTypes> bool operator==(const function<R(ArgTypes...)>&, nullptr_t) noexcept; template<class R, class... ArgTypes> bool operator==(nullptr_t, const function<R(ArgTypes...)>&) noexcept; template<class R, class... ArgTypes> bool operator!=(const function<R(ArgTypes...)>&, nullptr_t) noexcept; template<class R, class... ArgTypes> bool operator!=(nullptr_t, const function<R(ArgTypes...)>&) noexcept; // [func.search], searchers template<class ForwardIterator, class BinaryPredicate = equal_to<>> class default_searcher; // freestanding template<class RandomAccessIterator, class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>, class BinaryPredicate = equal_to<>> class boyer_moore_searcher; template<class RandomAccessIterator, class Hash = hash<typename iterator_traits<RandomAccessIterator>::value_type>, class BinaryPredicate = equal_to<>> class boyer_moore_horspool_searcher; // [unord.hash], hash function primary template template<class T> struct hash; // freestanding // [func.bind], function object binders template<class T> inline constexpr bool is_bind_expression_v = is_bind_expression<T>::value; // freestanding template<class T> inline constexpr int is_placeholder_v = is_placeholder<T>::value; // freestanding namespace ranges { // [range.cmp], range comparisons template<class T = void> requires see below struct equal_to; // freestanding template<class T = void> requires see below struct not_equal_to; // freestanding template<class T = void> requires see below struct greater; // freestanding template<class T = void> requires see below struct less; // freestanding template<class T = void> requires see below struct greater_equal; // freestanding template<class T = void> requires see below struct less_equal; // freestanding template<> struct equal_to<void>; // freestanding template<> struct not_equal_to<void>; // freestanding template<> struct greater<void>; // freestanding template<> struct less<void>; // freestanding template<> struct greater_equal<void>; // freestanding template<> struct less_equal<void>; // freestanding } }
Change in [string.syn]:?.?.? Header <charconv> synopsis [charconv.syn]
namespace std { // floating-point format for primitive numerical conversion enum class chars_format { scientific = unspecified, fixed = unspecified, hex = unspecified, general = fixed | scientific }; // [charconv.to.chars], primitive numerical output conversion struct to_chars_result { char* ptr; errc ec; }; // freestanding to_chars_result to_chars(char* first, char* last, see below value, int base = 10); // freestanding to_chars_result to_chars(char* first, char* last, float value); to_chars_result to_chars(char* first, char* last, double value); to_chars_result to_chars(char* first, char* last, long double value); to_chars_result to_chars(char* first, char* last, float value, chars_format fmt); to_chars_result to_chars(char* first, char* last, double value, chars_format fmt); to_chars_result to_chars(char* first, char* last, long double value, chars_format fmt); to_chars_result to_chars(char* first, char* last, float value, chars_format fmt, int precision); to_chars_result to_chars(char* first, char* last, double value, chars_format fmt, int precision); to_chars_result to_chars(char* first, char* last, long double value, chars_format fmt, int precision); // [charconv.from.chars], primitive numerical input conversion struct from_chars_result { const char* ptr; errc ec; }; // freestanding from_chars_result from_chars(const char* first, const char* last, see below& value, int base = 10); // freestanding from_chars_result from_chars(const char* first, const char* last, float& value, chars_format fmt = chars_format::general); from_chars_result from_chars(const char* first, const char* last, double& value, chars_format fmt = chars_format::general); from_chars_result from_chars(const char* first, const char* last, long double& value, chars_format fmt = chars_format::general); }
Change in [string.view.synop]:?.?.? Header <string> synopsis [string.syn]
#include <initializer_list> namespace std { // [char.traits], character traits template<class charT> struct char_traits; // freestanding template<> struct char_traits<char>; // freestanding template<> struct char_traits<char8_t>; // freestanding template<> struct char_traits<char16_t>; // freestanding template<> struct char_traits<char32_t>; // freestanding template<> struct char_traits<wchar_t>; // freestanding
Change in [string.view.template]:?.?.? Header <string_view> synopsis [string.view.synop]
namespace std { // [string.view.template], class template basic_string_view template<class charT, class traits = char_traits<charT>> class basic_string_view; // freestanding, partial // [string.view.comparison], non-member comparison functions template<class charT, class traits> constexpr bool operator==(basic_string_view<charT, traits> x, basic_string_view<charT, traits> y) noexcept; // freestanding template<class charT, class traits> constexpr bool operator!=(basic_string_view<charT, traits> x, basic_string_view<charT, traits> y) noexcept; // freestanding template<class charT, class traits> constexpr bool operator< (basic_string_view<charT, traits> x, basic_string_view<charT, traits> y) noexcept; // freestanding template<class charT, class traits> constexpr bool operator> (basic_string_view<charT, traits> x, basic_string_view<charT, traits> y) noexcept; // freestanding template<class charT, class traits> constexpr bool operator<=(basic_string_view<charT, traits> x, basic_string_view<charT, traits> y) noexcept; // freestanding template<class charT, class traits> constexpr bool operator>=(basic_string_view<charT, traits> x, basic_string_view<charT, traits> y) noexcept; // freestanding // see [string.view.comparison], sufficient additional overloads of comparison functions, freestanding // [string.view.io], inserters and extractors template<class charT, class traits> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, basic_string_view<charT, traits> str); // basic_string_view typedef names using string_view = basic_string_view<char>; // freestanding using u8string_view = basic_string_view<char8_t>; // freestanding using u16string_view = basic_string_view<char16_t>; // freestanding using u32string_view = basic_string_view<char32_t>; // freestanding using wstring_view = basic_string_view<wchar_t>; // freestanding // [string.view.hash], hash support template<class T> struct hash; // freestanding template<> struct hash<string_view>; // freestanding template<> struct hash<u8string_view>; // freestanding template<> struct hash<u16string_view>; // freestanding template<> struct hash<u32string_view>; // freestanding template<> struct hash<wstring_view>; // freestanding inline namespace literals { inline namespace string_view_literals { // [string.view.literals], suffix for basic_string_view literals constexpr string_view operator""sv(const char* str, size_t len) noexcept; // freestanding constexpr u8string_view operator""sv(const char8_t* str, size_t len) noexcept; // freestanding constexpr u16string_view operator""sv(const char16_t* str, size_t len) noexcept; // freestanding constexpr u32string_view operator""sv(const char32_t* str, size_t len) noexcept; // freestanding constexpr wstring_view operator""sv(const wchar_t* str, size_t len) noexcept; // freestanding } } }
Change in [cstring.syn]:// [string.view.access], element access constexpr const_reference operator[](size_type pos) const; constexpr const_reference at(size_type pos) const; // freestanding, omit constexpr const_reference front() const; constexpr const_reference back() const; constexpr const_pointer data() const noexcept; // [string.view.modifiers], modifiers constexpr void remove_prefix(size_type n); constexpr void remove_suffix(size_type n); constexpr void swap(basic_string_view& s) noexcept; // [string.view.ops], string operations constexpr size_type copy(charT* s, size_type n, size_type pos = 0) const; // freestanding, omit constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const; // freestanding, omit constexpr int compare(basic_string_view s) const noexcept; constexpr int compare(size_type pos1, size_type n1, basic_string_view s) const; // freestanding, omit constexpr int compare(size_type pos1, size_type n1, basic_string_view s, size_type pos2, size_type n2) const; // freestanding, omit constexpr int compare(const charT* s) const; constexpr int compare(size_type pos1, size_type n1, const charT* s) const; // freestanding, omit constexpr int compare(size_type pos1, size_type n1, const charT* s, size_type n2) const; // freestanding, omit
Change in [cwchar.syn]:?.?.? Header <cstring> synopsis [cstring.syn]
namespace std { using size_t = see [support.types.layout]; // freestanding void* memcpy(void* s1, const void* s2, size_t n); // freestanding void* memmove(void* s1, const void* s2, size_t n); // freestanding char* strcpy(char* s1, const char* s2); // freestanding char* strncpy(char* s1, const char* s2, size_t n); // freestanding char* strcat(char* s1, const char* s2); // freestanding char* strncat(char* s1, const char* s2, size_t n); // freestanding int memcmp(const void* s1, const void* s2, size_t n); // freestanding int strcmp(const char* s1, const char* s2); // freestanding int strcoll(const char* s1, const char* s2); int strncmp(const char* s1, const char* s2, size_t n); // freestanding size_t strxfrm(char* s1, const char* s2, size_t n); const void* memchr(const void* s, int c, size_t n); // see [library.c], freestanding void* memchr(void* s, int c, size_t n); // see [library.c], freestanding const char* strchr(const char* s, int c); // see [library.c], freestanding char* strchr(char* s, int c); // see [library.c], freestanding size_t strcspn(const char* s1, const char* s2); // freestanding const char* strpbrk(const char* s1, const char* s2); // see [library.c], freestanding char* strpbrk(char* s1, const char* s2); // see [library.c], freestanding const char* strrchr(const char* s, int c); // see [library.c], freestanding char* strrchr(char* s, int c); // see [library.c], freestanding size_t strspn(const char* s1, const char* s2); // freestanding const char* strstr(const char* s1, const char* s2); // see [library.c], freestanding char* strstr(char* s1, const char* s2); // see [library.c], freestanding char* strtok(char* s1, const char* s2); void* memset(void* s, int c, size_t n); // freestanding char* strerror(int errnum); size_t strlen(const char* s); // freestanding } #define NULL see [support.types.nullptr] // freestanding
Change in [array.syn]:?.?.? Header <cwchar> synopsis [cwchar.syn]
namespace std { using size_t = see [support.types.layout]; // freestanding using mbstate_t = see below; // freestanding using wint_t = see below; // freestanding struct tm; int fwprintf(FILE* stream, const wchar_t* format, ...); int fwscanf(FILE* stream, const wchar_t* format, ...); int swprintf(wchar_t* s, size_t n, const wchar_t* format, ...); int swscanf(const wchar_t* s, const wchar_t* format, ...); int vfwprintf(FILE* stream, const wchar_t* format, va_list arg); int vfwscanf(FILE* stream, const wchar_t* format, va_list arg); int vswprintf(wchar_t* s, size_t n, const wchar_t* format, va_list arg); int vswscanf(const wchar_t* s, const wchar_t* format, va_list arg); int vwprintf(const wchar_t* format, va_list arg); int vwscanf(const wchar_t* format, va_list arg); int wprintf(const wchar_t* format, ...); int wscanf(const wchar_t* format, ...); wint_t fgetwc(FILE* stream); wchar_t* fgetws(wchar_t* s, int n, FILE* stream); wint_t fputwc(wchar_t c, FILE* stream); int fputws(const wchar_t* s, FILE* stream); int fwide(FILE* stream, int mode); wint_t getwc(FILE* stream); wint_t getwchar(); wint_t putwc(wchar_t c, FILE* stream); wint_t putwchar(wchar_t c); wint_t ungetwc(wint_t c, FILE* stream); double wcstod(const wchar_t* nptr, wchar_t** endptr); float wcstof(const wchar_t* nptr, wchar_t** endptr); long double wcstold(const wchar_t* nptr, wchar_t** endptr); long int wcstol(const wchar_t* nptr, wchar_t** endptr, int base); long long int wcstoll(const wchar_t* nptr, wchar_t** endptr, int base); unsigned long int wcstoul(const wchar_t* nptr, wchar_t** endptr, int base); unsigned long long int wcstoull(const wchar_t* nptr, wchar_t** endptr, int base); wchar_t* wcscpy(wchar_t* s1, const wchar_t* s2); // freestanding wchar_t* wcsncpy(wchar_t* s1, const wchar_t* s2, size_t n); // freestanding wchar_t* wmemcpy(wchar_t* s1, const wchar_t* s2, size_t n); // freestanding wchar_t* wmemmove(wchar_t* s1, const wchar_t* s2, size_t n); // freestanding wchar_t* wcscat(wchar_t* s1, const wchar_t* s2); // freestanding wchar_t* wcsncat(wchar_t* s1, const wchar_t* s2, size_t n); // freestanding int wcscmp(const wchar_t* s1, const wchar_t* s2); // freestanding int wcscoll(const wchar_t* s1, const wchar_t* s2); int wcsncmp(const wchar_t* s1, const wchar_t* s2, size_t n); // freestanding size_t wcsxfrm(wchar_t* s1, const wchar_t* s2, size_t n); int wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n); // freestanding const wchar_t* wcschr(const wchar_t* s, wchar_t c); // see [library.c], freestanding wchar_t* wcschr(wchar_t* s, wchar_t c); // see [library.c], freestanding size_t wcscspn(const wchar_t* s1, const wchar_t* s2); // freestanding const wchar_t* wcspbrk(const wchar_t* s1, const wchar_t* s2); // see [library.c], freestanding wchar_t* wcspbrk(wchar_t* s1, const wchar_t* s2); // see [library.c], freestanding const wchar_t* wcsrchr(const wchar_t* s, wchar_t c); // see [library.c], freestanding wchar_t* wcsrchr(wchar_t* s, wchar_t c); // see [library.c], freestanding size_t wcsspn(const wchar_t* s1, const wchar_t* s2); // freestanding const wchar_t* wcsstr(const wchar_t* s1, const wchar_t* s2); // see [library.c], freestanding wchar_t* wcsstr(wchar_t* s1, const wchar_t* s2); // see [library.c], freestanding wchar_t* wcstok(wchar_t* s1, const wchar_t* s2, wchar_t** ptr); // freestanding const wchar_t* wmemchr(const wchar_t* s, wchar_t c, size_t n); // see [library.c], freestanding wchar_t* wmemchr(wchar_t* s, wchar_t c, size_t n); // see [library.c], freestanding size_t wcslen(const wchar_t* s); // freestanding wchar_t* wmemset(wchar_t* s, wchar_t c, size_t n); // freestanding size_t wcsftime(wchar_t* s, size_t maxsize, const wchar_t* format, const struct tm* timeptr); wint_t btowc(int c); int wctob(wint_t c); // [c.mb.wcs], multibyte / wide string and character conversion functions int mbsinit(const mbstate_t* ps); size_t mbrlen(const char* s, size_t n, mbstate_t* ps); size_t mbrtowc(wchar_t* pwc, const char* s, size_t n, mbstate_t* ps); size_t wcrtomb(char* s, wchar_t wc, mbstate_t* ps); size_t mbsrtowcs(wchar_t* dst, const char** src, size_t len, mbstate_t* ps); size_t wcsrtombs(char* dst, const wchar_t** src, size_t len, mbstate_t* ps); } #define NULL see [support.types.nullptr] // freestanding #define WCHAR_MAX see below // freestanding #define WCHAR_MIN see below // freestanding #define WEOF see below // freestanding
Change in [array.overview]:?.?.? Header <array> synopsis [array.syn]
#include <initializer_list> namespace std { // [array], class template array template<class T, size_t N> struct array; // freestanding, partial template<class T, size_t N> // freestanding constexpr bool operator==(const array<T, N>& x, const array<T, N>& y); template<class T, size_t N> // freestanding constexpr bool operator!=(const array<T, N>& x, const array<T, N>& y); template<class T, size_t N> // freestanding constexpr bool operator< (const array<T, N>& x, const array<T, N>& y); template<class T, size_t N> // freestanding constexpr bool operator> (const array<T, N>& x, const array<T, N>& y); template<class T, size_t N> // freestanding constexpr bool operator<=(const array<T, N>& x, const array<T, N>& y); template<class T, size_t N> // freestanding constexpr bool operator>=(const array<T, N>& x, const array<T, N>& y); template<class T, size_t N> // freestanding constexpr void swap(array<T, N>& x, array<T, N>& y) noexcept(noexcept(x.swap(y))); template<class T> class tuple_size; // freestanding template<size_t I, class T> class tuple_element; // freestanding template<class T, size_t N> struct tuple_size<array<T, N>>; // freestanding template<size_t I, class T, size_t N> struct tuple_element<I, array<T, N>>; // freestanding template<size_t I, class T, size_t N> constexpr T& get(array<T, N>&) noexcept; // freestanding template<size_t I, class T, size_t N> constexpr T&& get(array<T, N>&&) noexcept; // freestanding template<size_t I, class T, size_t N> constexpr const T& get(const array<T, N>&) noexcept; // freestanding template<size_t I, class T, size_t N> constexpr const T&& get(const array<T, N>&&) noexcept; // freestanding }
Change in [iterator.synopsis]:// element access constexpr reference operator[](size_type n); constexpr const_reference operator[](size_type n) const; constexpr reference at(size_type n); // freestanding, omit constexpr const_reference at(size_type n) const; // freestanding, omit constexpr reference front(); constexpr const_reference front() const; constexpr reference back(); constexpr const_reference back() const;
istream_iterator
, ostream_iterator
, istreambuf_iterator
, ostreambuf_iterator
, and their associated comparison functions).for_each_result
mismatch_result
copy_result
copy_n_result
copy_if_result
copy_backward_result
move_result
move_backward_result
swap_ranges_result
unary_transform_result
binary_transform_result
replace_copy_result
replace_copy_if_result
remove_copy_result
remove_copy_if_result
unique_copy_result
reverse_copy_result
rotate_copy_result
partition_copy_result
merge_result
set_union_result
set_intersection_result
set_difference_result
set_symmetric_difference_result
minmax_result
ranges
namespace):
all_of
any_of
none_of
for_each
for_each_n
find
find_if
find_if_not
find_end
find_first_of
adjacent_find
count
count_if
mismatch
equal
is_permutation
search
search_n
copy
copy_n
copy_if
copy_backward
move
move_backward
swap_ranges
iter_swap
transform
replace
replace_if
replace_copy
replace_copy_if
fill
fill_n
generate
generate_n
remove
remove_if
remove_copy
remove_copy_if
unique
unique_copy
reverse
reverse_copy
rotate
rotate_copy
sample
shuffle
shift_left
shift_right
sort
partial_sort
partial_sort_copy
is_sorted
is_sorted_until
nth_element
lower_bound
upper_bound
equal_range
binary_search
is_partitioned
partition
partition_copy
partition_point
merge
includes
set_union
set_intersection
set_difference
set_symmetric_difference
push_heap
pop_heap
make_heap
sort_heap
is_heap
is_heap_until
min
max
minmax
min_element
max_element
minmax_element
clamp
lexicographical_compare
compare_3way
lexicographical_compare_3way
next_permutation
prev_permutation
stable_sort
, stable_partition
, and inplace_merge
are purposefully omitted.accumulate
reduce
inner_product
transform_reduce
partial_sum
exclusive_scan
inclusive_scan
transform_exclusive_scan
transform_inclusive_scan
adjacent_difference
iota
gcd
lcm
Change in [cmath.syn]:?.?.? Header <random> synopsis [rand.synopsis]
#include <initializer_list> namespace std { // [rand.req.urng], uniform random bit generator requirements template<class G> concept UniformRandomBitGenerator = see below; // freestanding // [rand.eng.lcong], class template linear_congruential_engine template<class UIntType, UIntType a, UIntType c, UIntType m> class linear_congruential_engine; // freestanding // [rand.eng.mers], class template mersenne_twister_engine template<class UIntType, size_t w, size_t n, size_t m, size_t r, UIntType a, size_t u, UIntType d, size_t s, UIntType b, size_t t, UIntType c, size_t l, UIntType f> class mersenne_twister_engine; // freestanding // [rand.eng.sub], class template subtract_with_carry_engine template<class UIntType, size_t w, size_t s, size_t r> class subtract_with_carry_engine; // freestanding // [rand.adapt.disc], class template discard_block_engine template<class Engine, size_t p, size_t r> class discard_block_engine; // freestanding // [rand.adapt.ibits], class template independent_bits_engine template<class Engine, size_t w, class UIntType> class independent_bits_engine; // freestanding // [rand.adapt.shuf], class template shuffle_order_engine template<class Engine, size_t k> class shuffle_order_engine; // [rand.predef], engines and engine adaptors with predefined parameters using minstd_rand0 = see below; // freestanding using minstd_rand = see below; // freestanding using mt19937 = see below; // freestanding using mt19937_64 = see below; // freestanding using ranlux24_base = see below; // freestanding using ranlux48_base = see below; // freestanding using ranlux24 = see below; // freestanding using ranlux48 = see below; // freestanding using knuth_b = see below; using default_random_engine = see below; // freestanding // [rand.device], class random_device class random_device; // [rand.util.seedseq], class seed_seq class seed_seq; // [rand.util.canonical], function template generate_canonical template<class RealType, size_t bits, class URBG> RealType generate_canonical(URBG& g); // [rand.dist.uni.int], class template uniform_int_distribution template<class IntType = int> class uniform_int_distribution; // freestanding // [rand.dist.uni.real], class template uniform_real_distribution template<class RealType = double> class uniform_real_distribution;
Change 1 of 2 in [time.syn]:// [c.math.abs], absolute values int abs(int j); // freestanding long int abs(long int j);// freestanding long long int abs(long long int j); // freestanding float abs(float j); double abs(double j); long double abs(long double j);
Change 2 of 2 in [time.syn]:?.? Header <chrono> synopsis [time.syn]
namespace std { namespace chrono { // [time.duration], class template duration template<class Rep, class Period = ratio<1>> class duration; // freestanding // [time.point], class template time_point template<class Clock, class Duration = typename Clock::duration> class time_point; // freestanding } // [time.traits.specializations], common_type specializations template<class Rep1, class Period1, class Rep2, class Period2> struct common_type<chrono::duration<Rep1, Period1>, chrono::duration<Rep2, Period2>>; // freestanding template<class Clock, class Duration1, class Duration2> struct common_type<chrono::time_point<Clock, Duration1>, chrono::time_point<Clock, Duration2>>; // freestanding namespace chrono { // [time.traits], customization traits template<class Rep> struct treat_as_floating_point; // freestanding template<class Rep> struct duration_values; // freestanding template<class Rep> // freestanding inline constexpr bool treat_as_floating_point_v = treat_as_floating_point<Rep>::value; template<class T> struct is_clock; template<class T> inline constexpr bool is_clock_v = is_clock<T>::value; // [time.duration.nonmember], duration arithmetic template<class Rep1, class Period1, class Rep2, class Period2> constexpr common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>> // freestanding operator+(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); template<class Rep1, class Period1, class Rep2, class Period2> constexpr common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>> // freestanding operator-(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); template<class Rep1, class Period, class Rep2> constexpr duration<common_type_t<Rep1, Rep2>, Period> // freestanding operator*(const duration<Rep1, Period>& d, const Rep2& s); template<class Rep1, class Rep2, class Period> constexpr duration<common_type_t<Rep1, Rep2>, Period> // freestanding operator*(const Rep1& s, const duration<Rep2, Period>& d); template<class Rep1, class Period, class Rep2> constexpr duration<common_type_t<Rep1, Rep2>, Period> // freestanding operator/(const duration<Rep1, Period>& d, const Rep2& s); template<class Rep1, class Period1, class Rep2, class Period2> constexpr common_type_t<Rep1, Rep2> // freestanding operator/(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); template<class Rep1, class Period, class Rep2> constexpr duration<common_type_t<Rep1, Rep2>, Period> // freestanding operator%(const duration<Rep1, Period>& d, const Rep2& s); template<class Rep1, class Period1, class Rep2, class Period2> constexpr common_type_t<duration<Rep1, Period1>, duration<Rep2, Period2>> // freestanding operator%(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); // [time.duration.comparisons], duration comparisons template<class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator==(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); // freestanding template<class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator!=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); // freestanding template<class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator< (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); // freestanding template<class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator> (const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); // freestanding template<class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator<=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); // freestanding template<class Rep1, class Period1, class Rep2, class Period2> constexpr bool operator>=(const duration<Rep1, Period1>& lhs, const duration<Rep2, Period2>& rhs); // freestanding // [time.duration.cast], duration_cast template<class ToDuration, class Rep, class Period> // freestanding constexpr ToDuration duration_cast(const duration<Rep, Period>& d); template<class ToDuration, class Rep, class Period> // freestanding constexpr ToDuration floor(const duration<Rep, Period>& d); template<class ToDuration, class Rep, class Period> // freestanding constexpr ToDuration ceil(const duration<Rep, Period>& d); template<class ToDuration, class Rep, class Period> // freestanding constexpr ToDuration round(const duration<Rep, Period>& d); // [time.duration.io], duration I/O template<class charT, class traits, class Rep, class Period> basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& os, const duration<Rep, Period>& d); template<class charT, class traits, class Rep, class Period> basic_ostream<charT, traits>& to_stream(basic_ostream<charT, traits>& os, const charT* fmt, const duration<Rep, Period>& d); template<class charT, class traits, class Rep, class Period, class Alloc = allocator<charT>> basic_istream<charT, traits>& from_stream(basic_istream<charT, traits>& is, const charT* fmt, duration<Rep, Period>& d, basic_string<charT, traits, Alloc>* abbrev = nullptr, minutes* offset = nullptr); // convenience typedefs using nanoseconds = duration<signed integer type of at least 64 bits, nano>; // freestanding using microseconds = duration<signed integer type of at least 55 bits, micro>; // freestanding using milliseconds = duration<signed integer type of at least 45 bits, milli>; // freestanding using seconds = duration<signed integer type of at least 35 bits>; // freestanding using minutes = duration<signed integer type of at least 29 bits, ratio< 60>>; // freestanding using hours = duration<signed integer type of at least 23 bits, ratio<3600>>; // freestanding using days = duration<signed integer type of at least 25 bits, ratio_multiply<ratio<24>, hours::period>>; // freestanding using weeks = duration<signed integer type of at least 22 bits, ratio_multiply<ratio<7>, days::period>>; // freestanding using years = duration<signed integer type of at least 17 bits, ratio_multiply<ratio<146097, 400>, days::period>>; // freestanding using months = duration<signed integer type of at least 20 bits, ratio_divide<years::period, ratio<12>>>; // freestanding // [time.point.nonmember], time_point arithmetic template<class Clock, class Duration1, class Rep2, class Period2> // freestanding constexpr time_point<Clock, common_type_t<Duration1, duration<Rep2, Period2>>> operator+(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs); template<class Rep1, class Period1, class Clock, class Duration2> // freestanding constexpr time_point<Clock, common_type_t<duration<Rep1, Period1>, Duration2>> operator+(const duration<Rep1, Period1>& lhs, const time_point<Clock, Duration2>& rhs); template<class Clock, class Duration1, class Rep2, class Period2> // freestanding constexpr time_point<Clock, common_type_t<Duration1, duration<Rep2, Period2>>> operator-(const time_point<Clock, Duration1>& lhs, const duration<Rep2, Period2>& rhs); template<class Clock, class Duration1, class Duration2> // freestanding constexpr common_type_t<Duration1, Duration2> operator-(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); // [time.point.comparisons], time_point comparisons template<class Clock, class Duration1, class Duration2> // freestanding constexpr bool operator==(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); template<class Clock, class Duration1, class Duration2> // freestanding constexpr bool operator!=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); template<class Clock, class Duration1, class Duration2> // freestanding constexpr bool operator< (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); template<class Clock, class Duration1, class Duration2> // freestanding constexpr bool operator> (const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); template<class Clock, class Duration1, class Duration2> // freestanding constexpr bool operator<=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); template<class Clock, class Duration1, class Duration2> // freestanding constexpr bool operator>=(const time_point<Clock, Duration1>& lhs, const time_point<Clock, Duration2>& rhs); // [time.point.cast], time_point_cast template<class ToDuration, class Clock, class Duration> // freestanding constexpr time_point<Clock, ToDuration> time_point_cast(const time_point<Clock, Duration>& t); template<class ToDuration, class Clock, class Duration> // freestanding constexpr time_point<Clock, ToDuration> floor(const time_point<Clock, Duration>& tp); template<class ToDuration, class Clock, class Duration> // freestanding constexpr time_point<Clock, ToDuration> ceil(const time_point<Clock, Duration>& tp); template<class ToDuration, class Clock, class Duration> // freestanding constexpr time_point<Clock, ToDuration> round(const time_point<Clock, Duration>& tp); // [time.duration.alg], specialized algorithms template<class Rep, class Period> constexpr duration<Rep, Period> abs(duration<Rep, Period> d); // freestanding
Change in [cinttypes.syn]:inline namespace literals { inline namespace chrono_literals { // [time.duration.literals], suffixes for duration literals constexpr chrono::hours operator""h(unsigned long long); // freestanding constexpr chrono::duration<unspecified, ratio<3600, 1>> operator""h(long double); // freestanding constexpr chrono::minutes operator""min(unsigned long long); // freestanding constexpr chrono::duration<unspecified, ratio<60, 1>> operator""min(long double); // freestanding constexpr chrono::seconds operator""s(unsigned long long); // freestanding constexpr chrono::duration<unspecified> operator""s(long double); // freestanding constexpr chrono::milliseconds operator""ms(unsigned long long); // freestanding constexpr chrono::duration<unspecified, milli> operator""ms(long double); // freestanding constexpr chrono::microseconds operator""us(unsigned long long); // freestanding constexpr chrono::duration<unspecified, micro> operator""us(long double); // freestanding constexpr chrono::nanoseconds operator""ns(unsigned long long); // freestanding constexpr chrono::duration<unspecified, nano> operator""ns(long double); // freestanding // [time.cal.day.nonmembers], non-member functions constexpr chrono::day operator""d(unsigned long long d) noexcept; // freestanding // [time.cal.year.nonmembers], non-member functions constexpr chrono::year operator""y(unsigned long long y) noexcept; // freestanding } } namespace chrono { using namespace literals::chrono_literals; // freestanding } }
?.?.? Header <cinttypes> synopsis [cinttypes.syn]
#include <cstdint> // see [cstdint.syn] namespace std { using imaxdiv_t = see below; // freestanding intmax_t imaxabs(intmax_t j); // freestanding imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom); // freestanding intmax_t strtoimax(const char* nptr, char** endptr, int base); uintmax_t strtoumax(const char* nptr, char** endptr, int base); intmax_t wcstoimax(const wchar_t* nptr, wchar_t** endptr, int base); uintmax_t wcstoumax(const wchar_t* nptr, wchar_t** endptr, int base); intmax_t abs(intmax_t); // optional, see below, freestanding imaxdiv_t div(intmax_t, intmax_t); // optional, see below, freestanding }
Thanks to Brandon Streiff, Joshua Cannon, Phil Hindman, and Irwan Djajadi for reviewing this proposal.
Thanks to Odin Holmes for helping publicize this paper, presenting it in Rapperswil, and providing feedback.
Similar work was done in the C++11 timeframe by Lawrence Crowl and Alberto Ganesh Barbati in N3256.
CppCon talks on getting C++ support in various unusual environments:
[Baker2017] CppCon 2017: Billy Baker "Almost Unlimited Modern C++ in Kernel-Mode Applications"
[Quinn2016] CppCon 2016: Rian Quinn "Making C++ and the STL Work in the Linux / Windows Kernels"
[Bratterud2017] CppCon 2017: Alfred Bratterud "Deconstructing the OS: The devil's In the side effects"
[Meredith11] Conservative use of noexcept in the Library. A. Meredith; J. Lakos. N3279.