Namespaces
Variants
Views
Actions

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

From cppreference.com
m (Scope guard: -)
m (+ ISO number for consistency.)
 
(6 intermediate revisions by one user not shown)
Line 2: Line 2:
 
{{cpp/experimental/lib_extensions_3/navbar}}
 
{{cpp/experimental/lib_extensions_3/navbar}}
  
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 [[cpp/experimental/lib extensions|version 1]] and [[cpp/experimental/lib extensions 2|version 2]]. Components merged into C++17 are excluded from LFTS v3.
+
Version 3 of the C++ Extensions for Library Fundamentals, ISO/IEC TS 19568:2024, defines the following new components for the C++ standard library, in addition to those defined in [[cpp/experimental/lib extensions|version 1]] and [[cpp/experimental/lib extensions 2|version 2]].
 +
 
 +
Components merged into C++17/20 and the following components are removed in LFTS v3:
 +
* {{lc|std::experimental::make_array}},
 +
* {{lc|std::experimental::erased_type}},
 +
* {{ltt|cpp/experimental/lib_extensions/packaged_task|std::experimental::packaged_task}}, and
 +
* {{ltt|cpp/experimental/lib_extensions/promise|std::experimental::promise}}.
  
 
===Scope guard===
 
===Scope guard===
Line 10: Line 16:
 
{{dsc inc | cpp/experimental/dsc scope_fail}}
 
{{dsc inc | cpp/experimental/dsc scope_fail}}
 
{{dsc inc | cpp/experimental/dsc scope_success}}
 
{{dsc inc | cpp/experimental/dsc scope_success}}
{{dsc tclass | cpp/experimental/unique_resource | universal RAII resource handle wrapper}}
+
{{dsc inc | cpp/experimental/dsc unique_resource}}
 
{{dsc end}}
 
{{dsc end}}
  
 
===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}} is supported }}
 +
{{dsc header | experimental/functional }}
 +
{{dsc macro const | __cpp_lib_experimental_function_polymorphic_allocator | nolink=true | a value of at least {{c|202211}} indicates that {{c|std::pmr::polymorphic_allocator<>}} is used for {{ltt|cpp/experimental/function|std::experimental::function}} }}
 
{{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 guards 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}}

Latest revision as of 00:23, 6 November 2024

Version 3 of the C++ Extensions for Library Fundamentals, ISO/IEC TS 19568:2024, defines the following new components for the C++ standard library, in addition to those defined in version 1 and version 2.

Components merged into C++17/20 and the following components are removed in LFTS v3:

[edit] 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]

[edit] Feature test macros

__cpp_lib_experimental_memory_resources
a value of at least 201803 indicates that resource_adaptor is supported
(macro constant)
Defined in header <experimental/functional>
__cpp_lib_experimental_function_polymorphic_allocator
a value of at least 202211 indicates that std::pmr::polymorphic_allocator<> is used for std::experimental::function
(macro constant)
Defined in header <experimental/scope>
__cpp_lib_experimental_scope
a value of at least 201902 indicates that the scope guards are supported
(macro constant)

[edit] 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.