Namespaces
Variants
Views
Actions

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

From cppreference.com
(Feature test macros: P0987R2)
m (+ ISO number for consistency.)
 
(One intermediate revision 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]].
+
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]].
  
{{lc|std::experimental::make_array}} and components merged into C++17/20 are excluded from LFTS v3.
+
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===

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.