Namespaces
Variants
Views
Actions

Difference between revisions of "cpp/experimental/lib extensions 3"

From cppreference.com
m
(Feature test macros: LWG3649)
Line 17: Line 17:
 
===Feature test macros===
 
===Feature test macros===
 
{{dsc begin}}
 
{{dsc begin}}
 +
{{dsc header | experimental/memory_resource }}
 +
{{dsc macro const | __cpp_lib_experimental_memory_resources | nolink=true | a value of at least {{c|201803}} indicates that {{ltt|cpp/experimental/resource_adaptor}} and {{ltt|cpp/experimental/erased_type}} are supported }}
 
{{dsc header | experimental/scope}}
 
{{dsc header | experimental/scope}}
 
{{dsc macro const | __cpp_lib_experimental_scope | nolink=true | a value of at least {{c|201902}} indicates that the scope guard are supported }}
 
{{dsc macro const | __cpp_lib_experimental_scope | nolink=true | a value of at least {{c|201902}} indicates that the scope guard are supported }}
 
{{dsc end}}
 
{{dsc end}}
  
{{langlinks|ja|zh}}
+
===Notes===
 +
The value of {{tt|__cpp_lib_experimental_memory_resources}} has been increased in LFTS v3, because the design of {{ltt|cpp/experimental/resource_adaptor}} is rebased onto {{lc|std::pmr::memory_resource}}.
 +
 
 +
{{langlinks|de|es|fr|it|ja|pt|ru|zh}}

Revision as of 17:11, 26 September 2022

Version 3 of the C++ Extensions for Library Fundamentals, defines the following new components for the C++ standard library, in addition to those defined in version 1 and version 2.

std::experimental::make_array and components merged into C++17/20 are excluded from LFTS v3.

Scope guard

Defined in header <experimental/scope>
wraps a function object and invokes it on exiting the scope
(class template) [edit]
wraps a function object and invokes it on exiting the scope through an exception
(class template) [edit]
wraps a function object and invokes it on exiting the scope normally
(class template) [edit]
universal RAII resource handle wrapper
(class template) [edit]

Feature test macros

__cpp_lib_experimental_memory_resources
a value of at least 201803 indicates that resource_adaptor and erased_type are supported
(macro constant)
Defined in header <experimental/scope>
__cpp_lib_experimental_scope
a value of at least 201902 indicates that the scope guard are supported
(macro constant)

Notes

The value of __cpp_lib_experimental_memory_resources has been increased in LFTS v3, because the design of resource_adaptor is rebased onto std::pmr::memory_resource.