NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

C++20
From Wikipedia, the free encyclopedia
Jump to navigationJump to search
C++20 is the informal name for the revision of the ISO/IEC standard for the C++ programming language expected to follow C++17.[1] The C++ Standards Committee began planning C++20 in July 2017.[2] The current draft is N4835.[3]

C++20 is a major update, like C++11 was and unlike the more limited C++14 and C++17 revisions,[4] with about as many new keywords added.

Below is a partial list of changes that have been accepted into or have been discussed for inclusion into C++20.[5]


Contents
1 New features
2 New (and changed) keywords
3 Features published as Technical Specifications
4 Features deferred to a later standard
5 See also
6 References
7 External links
New features
Changes applied to the C++20 working draft in July 2017 (Toronto) include:[6]

concepts[7]
designated initializers[8] (based on the C99 feature)
[=, this] as a lambda capture[9]
template parameter lists on lambdas[10]
Changes applied to the C++20 working draft in the fall meeting in November 2017 (Albuquerque) include:[11][12]

three-way comparison using the "spaceship operator", operator <=>
initialization of an additional variable within a range-based for statement
lambdas in unevaluated contexts[13][14]
default constructible and assignable stateless lambdas[13][15]
allow pack expansions in lambda init-capture[13][16]
string literals as template parameters[13][17]
atomic smart pointers (such as std::atomic<shared_ptr<T>> and std::atomic<weak_ptr<T>>)[18]
Changes applied to the C++20 working draft in March 2018 (Jacksonville) include:[19]

removing the need for typename in certain circumstances[20]
new standard attributes [[no_unique_address]],[21] [[likely]] and [[unlikely]][22]
calendar and time-zone additions to <chrono>[23]
std::span, providing a view to a contiguous array (analogous to std::string_view but span can mutate the referenced sequence)[24]
<version> header[25]
Changes applied to the C++20 working draft in the summer meeting in June 2018 (Rapperswil) include:[26]

contracts[27] (see list of features deferred to a later standard)
feature test macros[28]
bit-casting of object representations, with less verbosity than memcpy() and more ability to exploit compiler internals[29]
conditional explicit, allowing the explicit modifier to be contingent on a boolean expression[30]
constexpr virtual functions[31]
Changes applied to the C++20 working draft in the fall meeting in November 2018 (San Diego) include:

ranges (The One Ranges Proposal)[32]
concept terse syntax[33]
constexpr union,[34] try and catch[35] dynamic_cast and typeid,[36] std::pointer_traits[37]
various constexpr library bits[38]
immediate functions using the new consteval keyword[39]
signed integers are now defined to be represented using two's complement (signed integer overflow remains undefined behavior)[40]
refinements of the contracts facility (access control in contract conditions)[41] (see list of features deferred to a later standard)
a revised memory model[42]
Changes applied to the C++20 working draft in the winter meeting in February 2019 (Kona) include: [43] [44]

coroutines[45] – already experimentally supported in Clang 5[46]
modules[47] – experimentally supported in Clang 5[48] and Visual Studio 2015 Update 1[49] as well as GCC[50]
various improvements to structured bindings (interaction with lambda captures, static and thread_local storage duration)[51][52]
Changes applied to the C++20 working draft in the summer meeting in July 2019 (Cologne) include: [53] [54] [55]

contracts have been removed (see list of features deferred to a later standard)[56]
use of comma operator in subscript expressions has been deprecated[57]
constexpr additions (trivial default initialization,[58] unevaluated inline-assembly[59])
using scoped enums[60]
various changes to the spaceship-operator[61][62]
DR: minor changes to modules[63]
constinit keyword[64]
changes to concepts (removal of -> Type return-type-requirements[65])
(most of) volatile has been deprecated[66]
DR: [[nodiscard]] effects on constructors[67]
The new standard library concepts will not use PascalCase (rather standard_case, as rest of standard library)[68]
text formatting[69][70] (chrono integration,[71] corner case fixes[72])
bit operations[73]
constexpr INVOKE[74]
math constants[75]
consistency additions to atomics (std::atomic_ref<T>,[76] std::atomic<std::shared_ptr<T>>[77])
add the spaceship (<=>) operator to the standard library[78]
header units for the standard library[79]
synchronization facilities[80] (merged from: Efficient atomic waiting and semaphores,[81] latches and barriers,[82] Improving atomic_flag,[83] Don't Make C++ Unimplementable On Small CPUs[84])
std::source_location[85]
constexpr containers (std::string,[86] std::vector[87])
std::stop_token and joining thread (std::jthread)[88]
New (and changed) keywords
Many new keywords added (and the new "spaceship operator", operator <=>), such as concept, constinit,[64] consteval, co_await, co_return, co_yield, requires (plus changed meaning for export), and char8_t.[89] And explicit can take an expression since C++20.[90] (Most of) the use for the volatile keyword has been deprecated.[66]

In addition to keywords, there are identifiers with special meaning, including new import and module.

C++ has added a number of attributes over the years, including new in C++20, [[likely]] and [[unlikely]]; and [[no_unique_address]].[91]

Features published as Technical Specifications
Parallelism TS v2[92] (including task blocks[93])
Networking TS v1[94]
Reflection TS v1[95]
Features deferred to a later standard
Contracts – a new study group (SG21) has been formed to work on a new proposal[96]
Reflection[97][98]
Metaclasses[99]
Executors[100]
Networking extensions,[101][102] including async, basic I/O services, timers, buffers and buffer-oriented streams, sockets, and Internet protocols (blocked by executors)
Properties[103]
Extended futures[104]
See also
C++
C++98
C++03
C++11
C++14
C++17
C11 (C standard revision)
C18 (C standard revision)
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.