C++ standard libraries extensions
From cppreference.com
< cpp | experimental
The C++ Extensions for Library Fundamentals, ISO/IEC TS 19568:2015 defines the following new components for the C++ standard library:
Contents |
[edit] Not merged into C++17
The following components of ISO/IEC TS 19568:2015 were not selected for inclusion in C++17
[edit] Modified versions of existing classes to support type-erased allocators
Defined in header
<experimental/functional> |
|
a modified version of std::function with support for type-erased allocators (class template) |
|
Defined in header
<experimental/future> |
|
a modified version of std::promise with support for type-erased allocators (class template) |
|
a modified version of std::packaged_task with support for type-erased allocators (class template) |
[edit] Polymorphic allocators and memory resources
adapts an allocator into a memory_resource (alias template) |
[edit] General utilities
Defined in header
<experimental/utility> |
|
placeholder type for type erasure, such as in allocators (class) |
|
Defined in header
<experimental/type_traits> |
|
deduce the implied function type of the callable object when called with the given argument types (class template) |
[edit] Merged into C++17
The following components of ISO/IEC TS 19568:2015 were included into C++17
[edit] optional objects
Defined in header
<experimental/optional> |
|
a class template representing optional objects (class template) |
[edit] class any
Defined in header
<experimental/any> |
|
a type-safe container for single values of any type (class) |
[edit] string_view
Defined in header
<experimental/string_view> |
|
a non-owning reference to a string (class template) |
[edit] Type-erased and polymorphic allocators
[edit] Polymorphic allocators and memory resources
The entities in this section are declared in the std::experimental::pmr namespace.
Defined in header
<experimental/memory_resource> |
|
an abstract interface for classes that encapsulate memory resources (class) |
|
a thread-safe memory_resource for managing allocations in pools of different block sizes (class) |
|
a thread-unsafe memory_resource for managing allocations in pools of different block sizes (class) |
|
a special-purpose memory_resource that releases the allocated memory only when the resource is destroyed (class) |
|
an allocator that supports run-time polymorphism based on the memory_resource it is constructed with (class template) |
|
returns a static program-wide memory_resource that uses the global operator new and operator delete to allocate and deallocate memory (function) |
|
returns a static memory_resource that performs no allocation (function) |
|
gets the default memory_resource (function) |
|
sets the default memory_resource (function) |
[edit] Convenience aliases for containers using polymorphic allocators
Convenience aliases and alias templates for containers using polymorphic allocators are provided in the std::experimental::pmr
namespace for the following class templates in the standard library:
List of container templates for which convenience aliases are provided |
---|
[edit]
Defined in header
<experimental/memory> |
|
Class | Description |
A modified version of std::shared_ptr that supports arrays (class template) |
|
A modified version of std::weak_ptr that supports arrays (class template) |
[edit] Sampling and searching algorithms
Defined in header
<experimental/algorithm> |
|
selects n random elements from a sequence (function template) |
|
applies a Searcher to a sequence (function template) |
|
Defined in header
<experimental/functional> |
|
standard C++ library search algorithm implementation (class template) |
|
helper function to create a default_searcher (function template) |
|
Boyer-Moore search algorithm implementation (class template) |
|
helper function to create a boyer_moore_searcher (function template) |
|
Boyer-Moore-Horspool search algorithm implementation (class template) |
|
helper function to create a boyer_moore_horspool_searcher (function template) |
[edit] General utilities
Defined in header
<experimental/tuple> |
|
calls a function to a tuple of arguments (function template) |
In addition, the TS provides numerous constexpr
variable templates for the following type traits and other class templates in the standard library:
[edit] Feature test macros
Defined in header
<experimental/optional> |
|
a value of at least 201411 indicates that the optional type is supported (macro constant) |
|
Defined in header
<experimental/any> |
|
a value of at least 201411 indicates that the any type is supported (macro constant) |
|
Defined in header
<experimental/string_view> |
|
a value of at least 201411 indicates that basic_string_view template is supported (macro constant) |
|
Defined in header
<experimental/tuple> |
|
a value of at least 201402 indicates that the tuple apply() function is supported (macro constant) |
|
Defined in header
<experimental/type_traits> |
|
a value of at least 201402 indicates that variable template type traits are supported (macro constant) |
|
a value of at least 201406 indicates that invocation type traits are supported (macro constant) |
|
Defined in header
<experimental/functional> |
|
a value of at least 201411 indicates that additional searching algorithms are supported (macro constant) |
|
a value of at least 201406 indicates that type-erased allocator for std::function is supported (macro constant) |
|
Defined in header
<experimental/future> |
|
a value of at least 201406 indicates that type-erased allocator for std::promise is supported (macro constant) |
|
a value of at least 201406 indicates that type-erased allocator for std::packaged_task is supported (macro constant) |
|
Defined in header
<experimental/memory> |
|
a value of at least 201406 indicates that shared_ptr arrays are supported (macro constant) |
|
Defined in header
<experimental/memory_resource> |
|
a value of at least 201402 indicates that polymorphic memory resources are supported (macro constant) |
|
Defined in header
<experimental/algorithm> |
|
a value of 201402 indicates that the sample algorithm is supported (macro constant) |