C++20
Da cppreference.com
< cpp
Predefinição:cpp/version/navbar
The next major revision of the C++ standard
Esta seção está incompleta |
Following features are about to be merged into C++20:
- From TS's: Coroutines, Modules, Constraints and concepts, abbreviated function templates,
- From TS's: Ranges, uniform container erasure (std::erase/std::erase_if)
Índice |
[editar] New language features
- Feature test macros
- 3-way comparison operator <=> and operator==() = default
- designated initializers
- init-statements and initializers in range-
for
- char8_t
-
[[no_unique_address]]
-
[[likely]]
-
[[unlikely]]
- pack-expansions in lambda captures
- removed the requirement to use
typename
to disambiguate types in many contexts - consteval, constinit
- further relaxed constexpr
- signed integers are 2's complement
- aggregate initialization using parentheses
- Coroutines
- Modules
- Concepts
- abbreviated function templates
- DR: array new can deduce array size
[editar] New library features
[editar] New headers
- Predefinição:header
- Predefinição:header
- Predefinição:header
- Predefinição:header
- Predefinição:header
- Predefinição:header
- Predefinição:header
- Predefinição:header
- Predefinição:header
- Predefinição:header
- Predefinição:header
[editar] Library features
- Formatting library
- Calendar and Time Zone library
- std::source_location
- std::span
- std::endian
- array support for std::make_shared
- std::remove_cvref
- std::to_address
- floating point and shared_ptr atomics
- std::barrier, std::latch, and std::counting_semaphore
- std::jthread and thread cancellation classes
-
<version>
- std::osyncstream
- std::u8string and other char8_t uses
- constexpr for
<algorithm>
,<utility>
,<complex>
-
std::string(_view)::starts_with
andends_with
- std::assume_aligned
- std::bind_front
- std::c8rtomb/std::mbrtoc8
- std::make_obj_using_allocator etc
- std::make_shared_for_overwrite/std::make_unique_for_overwrite
- heterogeneous lookup in unordered associative containers
- std::polymoprhic_allocator with additional member functions and std::byte as its default template argument
- std::execution::unseq
- std::midpoint and std::lerp
- std::ssize
- std::is_bounded_array
- Ranges
- uniform container erasure (
std::erase
/std::erase_if
) - Mathematical constants
[editar] Defect reports
Esta seção está incompleta |
[editar] Compiler support
Main Article: C++ compiler support Predefinição:cpp/compiler support/20 Predefinição:cpp/compiler support/note