C++20
De 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)
New language features
- Feature test macros
- 3-way comparison operator
<=>andoperator==() = 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
typenameto 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
New library features
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
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_tuses - constexpr for
<algorithm>,<utility>,<complex> std::string(_view)::starts_withandends_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
Defect reports
| Esta seção está incompleta |
Compiler support
Main Article: C++ compiler support Predefinição:cpp/compiler support/20 Predefinição:cpp/compiler support/note