C++20#Deferred to a later standard

{{Short description|2020 edition of the C++ programming language standard}}

{{C++ language revisions}}

C++20 is a version of the ISO/IEC 14882 standard for the C++ programming language. C++20 replaced the prior version of the C++ standard, called C++17, and was later replaced by C++23.{{cite web |title=The Standard |url=https://isocpp.org/std/the-standard |website=isocpp.org |accessdate=7 September 2020 |archive-date=19 September 2020 |archive-url=https://web.archive.org/web/20200919050617/https://isocpp.org/std/the-standard |url-status=live }} The standard was technically finalized{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1000r3.pdf|title=P1000R3: C++ IS schedule|last=Sutter|first=Herb|date=2019-10-01|website=|access-date=2020-02-13|archive-date=2019-11-14|archive-url=https://web.archive.org/web/20191114141143/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1000r3.pdf|url-status=live}} by WG21 at the meeting in Prague in February 2020,{{cite web|url=https://open-std.org/JTC1/SC22/WG21/docs/papers/2019/n4817.pdf|title=N4817: 2020 Prague Meeting Invitation and Information|last=Dusíková|first=Hana|date=2019-11-06|website=|url-status=live|archive-url=https://web.archive.org/web/20191229102449/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/n4817.pdf |archive-date=2019-12-29 |access-date=2020-02-13}} had its final draft version announced in March 2020,{{cite web | url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4859.html | title=N4859 Editors' Report -- Programming Languages -- C++ | access-date=2023-09-22 | archive-url=https://web.archive.org/web/20221209132251/https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4859.html | archive-date=2022-12-09 | url-status=live}} was approved on 4 September 2020,{{cite web |title=Current Status |url=https://isocpp.org/std/status |website=isocpp.org |accessdate=7 September 2020 |archive-date=8 September 2020 |archive-url=https://web.archive.org/web/20200908083135/https://isocpp.org/std/status |url-status=live }}{{cite web |title=C++20 Approved -- Herb Sutter |url=https://isocpp.org/blog/2020/09/cpp20-approved-herb-sutter |website=isocpp.org |accessdate=8 September 2020 |archive-date=11 September 2020 |archive-url=https://web.archive.org/web/20200911150359/https://isocpp.org/blog/2020/09/cpp20-approved-herb-sutter |url-status=live }} and published in December 2020.{{cite web|url=https://www.iso.org/standard/79358.html|title=ISO/IEC 14882:2020|access-date=2020-12-16|archive-date=2020-12-16|archive-url=https://web.archive.org/web/20201216154357/https://www.iso.org/standard/79358.html|url-status=live}}

Features

C++20 adds more new major features than C++14 or C++17.{{cite web|url=https://herbsutter.com/2019/07/13/draft-faq-why-does-the-c-standard-ship-every-three-years/|title=Why does the C++ standard ship every three years?|date=13 July 2019|access-date=19 July 2019|archive-date=13 July 2019|archive-url=https://web.archive.org/web/20190713161618/https://herbsutter.com/2019/07/13/draft-faq-why-does-the-c-standard-ship-every-three-years/|url-status=live}} Changes that have been accepted into C++20 include:{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0592r0.html|title=P0592R0: To boldly suggest an overall plan for C++20|publisher=|access-date=2017-05-06|archive-date=2017-03-08|archive-url=https://web.archive.org/web/20170308143910/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0592r0.html|url-status=live}}

= Language =

  • concepts,{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0606r0.pdf|title=P0606R0: Concepts Are Ready|publisher=|access-date=2017-05-06|archive-date=2017-03-28|archive-url=https://web.archive.org/web/20170328144243/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0606r0.pdf|url-status=live}} with terse syntax{{cite web|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p1141r1.html|title=P1141R1 - Yet another approach for constrained declarations|access-date=2018-11-11|archive-date=2018-11-11|archive-url=https://web.archive.org/web/20181111133625/http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p1141r1.html|url-status=live}}
  • modules{{cite web|url=https://isocpp.org/files/papers/n4720.pdf|title=N4720: Working Draft, Extensions to C++ for Modules|publisher=|access-date=2019-04-30|archive-date=2019-04-30|archive-url=https://web.archive.org/web/20190430095053/https://isocpp.org/files/papers/n4720.pdf|url-status=live}}
  • designated initializers{{cite web|url=https://wg21.link/p0329|title=Designated Initialization Wording|author1=Tim Shen|author2=Richard Smith|access-date=2017-07-16|archive-date=2017-10-15|archive-url=https://web.archive.org/web/20171015165744/https://wg21.link/p0329|url-status=live}} (based on the C99 feature, and common g++ extension)
  • [=, this] as a lambda capture{{cite web|url=https://wg21.link/p0409|title=Allow lambda capture [=, this]|author=Thomas Köppe|access-date=2017-07-16|archive-date=2019-02-09|archive-url=https://web.archive.org/web/20190209180040/https://wg21.link/p0409|url-status=live}}
  • template parameter lists on lambdas{{cite web|url=https://wg21.link/p0428|title=Familiar template syntax for generic lambdas|access-date=2017-07-16|archive-date=2018-11-21|archive-url=https://web.archive.org/web/20181121022051/https://wg21.link/p0428|url-status=live}}
  • three-way comparison using the "spaceship operator", operator <=>
  • initialization of an additional variable within a range-based for statement{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0614r0.html|title=Range-based for statements with initializer|access-date=2019-10-30|archive-date=2017-04-06|archive-url=https://web.archive.org/web/20170406231710/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0614r0.html|url-status=live}}
  • lambdas in unevaluated contexts{{cite news|url=https://botondballo.wordpress.com/2017/11/20/trip-report-c-standards-meeting-in-albuquerque-november-2017/|title=Trip Report: C++ Standards Meeting in Albuquerque, November 2017|date=2017-11-20|work=There's Waldo!|access-date=2017-12-11|language=en-US|archive-date=2017-12-11|archive-url=https://web.archive.org/web/20171211161242/https://botondballo.wordpress.com/2017/11/20/trip-report-c-standards-meeting-in-albuquerque-november-2017/|url-status=live}}{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0315r4.pdf|title=Wording for lambdas in unevaluated contexts|access-date=2017-12-11|archive-date=2017-12-12|archive-url=https://web.archive.org/web/20171212031428/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0315r4.pdf|url-status=live}}
  • default constructible and assignable stateless lambdas{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0624r2.pdf|title=Default constructible and assignable stateless lambdas|access-date=2017-12-11|archive-date=2017-12-12|archive-url=https://web.archive.org/web/20171212031425/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0624r2.pdf|url-status=live}}
  • allow pack expansions in lambda init-capture{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0780r0.html|title=Pack expansion in lambda init-capture|website=www.open-std.org|access-date=2017-12-11|archive-date=2020-02-14|archive-url=https://web.archive.org/web/20200214081039/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0780r0.html|url-status=live}}
  • class types in non-type template parameters, also allowing string literals as template parameters{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0732r2.pdf|title=Class Types in Non-Type Template Parameters|date=2018-06-06|website=www.open-std.org|access-date=2022-02-18|archive-date=2022-02-05|archive-url=https://web.archive.org/web/20220205083651/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0732r2.pdf|url-status=live}}
  • removing the need for typename in certain circumstances{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0634r3.html|title=Down with typename!|author1=Nina Ranns|author2=Daveed Vandevoorde|access-date=2019-05-18|archive-date=2018-04-22|archive-url=https://web.archive.org/web/20180422180216/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0634r3.html|url-status=live}}
  • new standard attributes no_unique_address,{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0840r2.html|title=Language support for empty objects|access-date=2019-08-04|archive-date=2018-04-17|archive-url=https://web.archive.org/web/20180417180340/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0840r2.html|url-status=live}} likely and unlikely{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0479r5.html|title=Proposed wording for likely and unlikely attributes (Revision 5)|access-date=2019-05-18|archive-date=2018-05-13|archive-url=https://web.archive.org/web/20180513080343/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0479r5.html|url-status=live}}
  • conditional explicit, allowing the explicit modifier to be contingent on a Boolean expression{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0892r2.html|title=explicit(bool)|website=www.open-std.org|access-date=2018-11-13|archive-date=2018-07-20|archive-url=https://web.archive.org/web/20180720061629/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0892r2.html|url-status=live}}
  • expanded constexpr: virtual functions,{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1064r0.html|title=Allowing Virtual Function Calls in Constant Expressions|website=www.open-std.org|access-date=2019-03-11|archive-date=2018-06-11|archive-url=https://web.archive.org/web/20180611142757/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1064r0.html|url-status=live}} union,{{cite web|url=https://wg21.link/p1330|title=P1330R0 - Changing the active member of a union inside constexpr|access-date=2019-07-26|archive-date=2019-07-26|archive-url=https://web.archive.org/web/20190726101620/https://wg21.link/p1330|url-status=live}} try and catch,{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1002r0.pdf|title=P1002R0 - Try-catch blocks in constexpr functions|access-date=2018-11-11|archive-date=2018-11-11|archive-url=https://web.archive.org/web/20181111133628/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1002r0.pdf|url-status=live}} dynamic_cast and typeid,{{cite web|url=https://wg21.link/p1327|title=P1327R0 - Allowing dynamic_cast, polymorphic typeid in Constant Expressions|access-date=2019-07-26|archive-date=2019-07-26|archive-url=https://web.archive.org/web/20190726101620/https://wg21.link/p1327|url-status=live}} std::pointer_traits{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1006r1.pdf|title=P1006R1 - Constexpr in std::pointer_traits|access-date=2018-11-11|archive-date=2018-11-11|archive-url=https://web.archive.org/web/20181111133625/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1006r1.pdf|url-status=live}}
  • immediate functions using the new consteval keyword{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r2.html|title=P1073R2 - Immediate functions|access-date=2018-11-11|archive-date=2018-10-26|archive-url=https://web.archive.org/web/20181026124307/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r2.html|url-status=live}}
  • signed integers are now defined to be represented using two's complement (signed integer overflow remains undefined behavior){{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1236r0.html|title=P1236R0: Alternative Wording for P0907R4 Signed Integers are Two's Complement|access-date=2018-11-11|archive-date=2018-11-11|archive-url=https://web.archive.org/web/20181111133642/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1236r0.html|url-status=live}}
  • a revised memory model{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0668r4.html|title=P0668R4: Revising the C++ memory model|access-date=2018-11-11|archive-date=2018-11-11|archive-url=https://web.archive.org/web/20181111133634/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0668r4.html|url-status=live}}
  • various improvements to structured bindings (interaction with lambda captures, static and thread_local storage duration){{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1091r1.html|title=P1091R1: Extending structured bindings to be more like variable declarations|website=www.open-std.org|access-date=2019-02-24|archive-date=2019-01-26|archive-url=https://web.archive.org/web/20190126105655/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1091r1.html|url-status=live}}{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1091r2.html|title=P1091R2: Extending structured bindings to be more like variable declarations|website=www.open-std.org|access-date=2019-02-24|archive-date=2019-01-26|archive-url=https://web.archive.org/web/20190126112016/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1091r2.html|url-status=live}}
  • coroutines{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4649.pdf|title=N4649: Working Draft, Technical Specification for C++ Extensions for Coroutines|publisher=|access-date=2017-05-06|archive-date=2017-05-16|archive-url=https://web.archive.org/web/20170516185504/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4649.pdf|url-status=live}}
  • using on scoped enums
  • constinit keyword{{cite web|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1143r2.html|title=P1143R2: Adding the constinit keyword|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001957/http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1143r2.html|url-status=live}}

= Library =

  • ranges (The One Ranges Proposal){{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r3.pdf|title=P0896R3|access-date=2018-11-11|archive-date=2018-11-11|archive-url=https://web.archive.org/web/20181111133612/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r3.pdf|url-status=live}}
  • std::make_shared and std::allocate_shared for arrays{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0674r1.html|title=Extending make_shared to Support Arrays|access-date=2020-02-12|archive-date=2017-09-06|archive-url=https://web.archive.org/web/20170906070027/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0674r1.html|url-status=live}}
  • atomic smart pointers (such as std::atomic> and std::atomic>){{cite web |last1=Meredith |first1=Alisdair |last2=Sutter |first2=Herb |title=Revising atomic_shared_ptr for C++20 |url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html |website=JTC1/SC22/WG21 - The C++ Standards Committee - ISOCPP |publisher=ISO |accessdate=27 December 2018 |archive-date=4 January 2018 |archive-url=https://web.archive.org/web/20180104184159/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0718r2.html |url-status=live }}
  • std::to_address to convert a pointer to a raw pointer{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0653r2.html|title=Utility to convert a pointer to a raw pointer|access-date=2020-02-12|archive-date=2018-02-20|archive-url=https://web.archive.org/web/20180220012525/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0653r2.html|url-status=live}}
  • calendar and time-zone additions to {{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0355r7.html|title=Extending to Calendars and Time Zones|author1=Howard E. Hinnant|author2=Tomasz Kamiński|access-date=2019-05-18|archive-date=2018-05-13|archive-url=https://web.archive.org/web/20180513074927/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0355r7.html|url-status=live}}
  • std::span, providing a view to a contiguous array (analogous to std::string_view but span can mutate the referenced sequence){{cite web|url=http://wg21.link/p0122|title=span: bounds-safe views for sequences of objects|author1=Neil MacIntosh|author2=Stephan T. Lavavej|access-date=2019-05-18|archive-date=2019-05-18|archive-url=https://web.archive.org/web/20190518102826/http://wg21.link/p0122|url-status=live}}
  • std::erase and std::erase_if, simplifying element erasure for most standard containers{{Cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html|title=Adopt Consistent Container Erasure from Library Fundamentals 2 for C++20|date=2018-10-04|author1=Alisdair Meredith|author2=Stephan T. Lavavej|access-date=2020-12-14|archive-date=2021-03-08|archive-url=https://web.archive.org/web/20210308123055/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1209r0.html|url-status=live}}
  • header{{cite web|url=http://wg21.link/p0754|title=|author=Alan Talbot|access-date=2019-05-18|archive-date=2019-05-18|archive-url=https://web.archive.org/web/20190518102900/http://wg21.link/p0754|url-status=live}}
  • std::bit_cast<> for type casting of object representations, with less verbosity than memcpy() and more ability to exploit compiler internals{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0476r2.html|title=Bit-casting object representations|website=www.open-std.org|access-date=2018-11-10|archive-date=2018-08-18|archive-url=https://web.archive.org/web/20180818190426/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0476r2.html|url-status=live}}
  • feature test macros{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0941r2.html|title=Integrating feature-test macros into the C++ WD (rev. 2)|website=www.open-std.org|access-date=2018-11-10|archive-date=2018-07-20|archive-url=https://web.archive.org/web/20180720144603/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0941r2.html|url-status=live}}
  • various constexpr library bits{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html|title=P1032R1 - Misc constexpr bits|access-date=2018-11-11|archive-date=2018-10-26|archive-url=https://web.archive.org/web/20181026124238/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html|url-status=live}}
  • smart pointer creation with default initialization{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1020r1.html|title=Smart pointer creation with default initialization|access-date=2020-02-12|archive-date=2019-01-26|archive-url=https://web.archive.org/web/20190126111714/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1020r1.html|url-status=live}}
  • contains-method for associative containers{{Cite web|title=P0458R2: Checking for Existence of an Element in Associative Containers|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0458r2.html|author1=Mikhail Maltsev|access-date=2022-01-02|archive-date=2022-01-16|archive-url=https://web.archive.org/web/20220116211430/https://www9.open-std.org/JTC1/SC22/WG21/docs/papers/2018/p0458r2.html|url-status=live}}
  • bit operations, such as leading/trailing zero/one count, and log2 operations{{cite web|url=https://wg21.link/p0556r3|title=P0556R3: Integral power-of-2 operations|date=2018-06-06|website=www.open-std.org|access-date=2020-08-08|archive-date=2019-06-26|archive-url=https://web.archive.org/web/20190626184254/https://wg21.link/p0556r3|url-status=live}}{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1355r2.html|title=P1355R2 Exposing a narrow contract for ceil2|date=2019-06-11|website=www.open-std.org|access-date=2020-08-08|archive-date=2019-08-05|archive-url=https://web.archive.org/web/20190805104347/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1355r2.html|url-status=live}}{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1956r1.pdf|title=On the names of low-level bit manipulation functions|date=2020-02-11|website=www.open-std.org|access-date=2020-08-08|archive-date=2020-03-24|archive-url=https://web.archive.org/web/20200324173059/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1956r1.pdf|url-status=live}}
  • std::bind_front{{Cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0356r3.html|title=Simplified partial function application|author=Tomasz Kamiński|date=2017-11-09|access-date=2020-11-08|archive-date=2020-09-28|archive-url=https://web.archive.org/web/20200928182706/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0356r3.html|url-status=live}}
  • std::atomic::wait, std::atomic::notify_one, andstd::atomic::notify_all were added, giving the standard library futex-like capabilities{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1643r1.html|title=P1643R1: Add wait/notify to atomic_ref<T>|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001955/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1643r1.html|url-status=live}}

= New and changed keywords =

Many new keywords added (and the new "spaceship operator", operator <=>), such as concept, constinit, consteval, co_await, co_return, co_yield, requires (plus changed meaning for export), and char8_t (for UTF-8 support).{{cite web|url=https://en.cppreference.com/w/cpp/keyword|title=C++ keywords - cppreference.com|website=en.cppreference.com|access-date=2019-08-04|archive-date=2012-03-19|archive-url=https://web.archive.org/web/20120319210634/https://en.cppreference.com/w/cpp/keyword|url-status=live}} And explicit can take an expression since C++20.{{cite web|url=https://en.cppreference.com/w/cpp/language/explicit|title=explicit specifier - cppreference.com|website=en.cppreference.com|access-date=2019-08-04|archive-date=2012-02-21|archive-url=https://web.archive.org/web/20120221163715/https://en.cppreference.com/w/cpp/language/explicit|url-status=live}} Most of the uses of the volatile keyword have been deprecated.

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

New attributes in C++20:

likely, unlikely, and no_unique_address{{cite web|url=https://en.cppreference.com/w/cpp/language/attributes|title=attribute specifier sequence(since C++11) - cppreference.com|website=en.cppreference.com|access-date=2019-08-04|archive-date=2012-07-05|archive-url=https://web.archive.org/web/20120705235229/https://en.cppreference.com/w/cpp/language/attributes|url-status=live}}

= Removed and deprecated =

Removed features:{{Cite web|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2020/n4861.pdf|title=Working Draft, Standard for Programming Language C++ (Annex C, §C.1)|access-date=2020-11-18|archive-date=2020-04-27|archive-url=https://web.archive.org/web/20200427145844/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/n4861.pdf|url-status=live}}

  • The C-derived headers , , , and were removed, as they serve no purpose in C++. (The corresponding <*.h> headers remain, for compatibility with C.)
  • The use of throw() as an exception specification was removed.
  • Some previously deprecated library features were removed, including std::uncaught_exception, std::raw_storage_iterator, std::is_literal_type, std::is_literal_type_v, std::result_of and std::result_of_t.

Deprecated features:

  • Use of comma operator in subscript expressions has been deprecated
  • (most of) volatile has been deprecated

Published as Technical Specifications

  • Parallelism TS v2{{cite web|url=https://wg21.link/N4793|title=C++ Extensions for Parallelism Version 2|access-date=2019-07-09|archive-date=2022-09-21|archive-url=https://web.archive.org/web/20220921201417/https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4793.pdf|url-status=live}} (including task blocks)
  • Reflection TS v1{{cite web|url=https://wg21.link/N4818|title=C++ Extensions for Reflection|access-date=2019-07-09|archive-date=2022-09-21|archive-url=https://web.archive.org/web/20220921201417/https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/n4818.pdf|url-status=live}}
  • Networking TS v1{{cite web|url=https://wg21.link/N4711|title=C++ Extensions for Networking|access-date=2019-07-09|archive-date=2022-09-21|archive-url=https://web.archive.org/web/20220921201418/https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4711.pdf|url-status=live}}

Deferred to a later standard

  • Contracts{{snd}} a new study group (SG21) has been formed to work on a new proposal{{cite web|url=https://herbsutter.com/2019/07/20/trip-report-summer-iso-c-standards-meeting-cologne/|title=Trip report: Summer ISO C++ standards meeting (Cologne)|last=Sutter|first=Herb|date=2019-07-20|website=Sutter's Mill|language=en|access-date=2019-07-21|archive-date=2020-04-17|archive-url=https://web.archive.org/web/20200417181512/https://herbsutter.com/2019/07/20/trip-report-summer-iso-c-standards-meeting-cologne/|url-status=live}}
  • Reflection{{cite web|url=https://meetingcpp.com/index.php/br/items/reflections-on-the-reflection-proposals.html|title=Reflections on the reflection proposals - Meeting C++|website=meetingcpp.com|language=en|access-date=2017-06-30|archive-date=2017-06-23|archive-url=https://web.archive.org/web/20170623034739/http://meetingcpp.com/index.php/br/items/reflections-on-the-reflection-proposals.html|url-status=live}}{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0194r6.html|title=Static reflection|website=www.open-std.org|access-date=2018-11-10|archive-date=2020-02-22|archive-url=https://web.archive.org/web/20200222002039/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0194r6.html|url-status=live}}
  • Metaclasses{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0707r0.pdf|title=Metaclasses|author=Herb Sutter|access-date=2017-07-23|archive-date=2020-11-11|archive-url=https://web.archive.org/web/20201111204111/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0707r0.pdf|url-status=live}}
  • Executors{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0443r10.html|title=A Unified Executors Proposal for C++|website=www.open-std.org|access-date=2019-02-24|archive-date=2020-02-20|archive-url=https://web.archive.org/web/20200220055757/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0443r10.html|url-status=live}}
  • Networking extensions,{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4771.pdf|title=N4771: Working Draft, C++ Extensions for Networking|publisher=|access-date=2019-03-23|archive-date=2020-04-19|archive-url=https://web.archive.org/web/20200419011113/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4771.pdf|url-status=live}}{{cite web|url=https://www.iso.org/standard/64030.html|title=ISO/IEC TS 19216:2018 Programming Languages -- C++ Extensions for Networking|publisher=|access-date=2018-12-17|archive-date=2019-01-15|archive-url=https://web.archive.org/web/20190115201923/https://www.iso.org/standard/64030.html|url-status=live}} including async, basic I/O services, timers, buffers and buffer-oriented streams, sockets, and Internet protocols (blocked by executors)
  • Properties{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1393r0.html|title=A General Property Customization Mechanism|website=www.open-std.org|access-date=2019-02-24|archive-date=2020-01-19|archive-url=https://web.archive.org/web/20200119114436/http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1393r0.html|url-status=live}}
  • Extended futures{{cite web|url=https://wg21.link/P1054|title=A Unified Futures Proposal for C++|access-date=2019-07-08|archive-date=2022-09-21|archive-url=https://web.archive.org/web/20220921201420/https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1054r0.html|url-status=live}}

Compiler support

Full support{{Cite web |title=C++ compiler support - cppreference.com |url=https://en.cppreference.com/w/cpp/compiler_support |access-date=2022-08-12 |website=en.cppreference.com |archive-date=2022-08-08 |archive-url=https://web.archive.org/web/20220808151657/https://en.cppreference.com/w/cpp/compiler_support |url-status=live }}

  • Visual Studio 2019 supports all C++20 features through its /std:c++latest option, as of version 16.10.0.{{Cite web|last=jawiddis|title=Visual Studio 2019 version 16.10 Release Notes|url=https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-v16.10#16.10.0|access-date=2021-07-13|website=docs.microsoft.com|language=en-us|archive-date=2021-08-11|archive-url=https://web.archive.org/web/20210811215520/https://docs.microsoft.com/en-us/visualstudio/releases/2019/release-notes-v16.10#16.10.0|url-status=live}} An option /std:c++20 to enable C++20 mode is added in version 16.11.0.{{Cite web|title=MSVC C++20 and the /std:c++20 Switch|url=https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/|access-date=2021-09-07|website=docs.microsoft.com|date=2 September 2021 |language=en-us|archive-date=2021-09-06|archive-url=https://web.archive.org/web/20210906151426/https://devblogs.microsoft.com/cppblog/msvc-cpp20-and-the-std-cpp20-switch/|url-status=live}}{{Citation |title=Visual Studio documentation for Microsoft C++ |date=2022-04-19 |url=https://github.com/MicrosoftDocs/cpp-docs/blob/578dd21279a897661686617375dff80f1eb2f40c/docs/overview/cpp-conformance-improvements.md |publisher=Microsoft Docs |access-date=2022-04-19 |archive-date=2022-04-19 |archive-url=https://web.archive.org/web/20220419161220/https://github.com/MicrosoftDocs/cpp-docs/blob/578dd21279a897661686617375dff80f1eb2f40c/docs/overview/cpp-conformance-improvements.md |url-status=live }}

Microsoft's compiler supports not only Windows but also Linux, Android, and iOS. However, for Linux development, it requires the "Visual C++ for Linux Development" extension. {{Cite web |title=Visual Studio 2019 Compatibility |url=https://docs.microsoft.com/en-us/visualstudio/releases/2019/compatibility |access-date=2022-08-12 |website=docs.microsoft.com |language=en-us |archive-date=2020-06-03 |archive-url=https://web.archive.org/web/20200603060110/https://docs.microsoft.com/en-us/visualstudio/releases/2019/compatibility |url-status=live }}

Partial

  • Clang has partial C++20 support that can be enabled with the option -std=c++20 (version 10 and later) or -std=c++2a (version 9 and earlier).{{Cite web |title=Clang - C++ Programming Language Status |url=https://clang.llvm.org/cxx_status.html |access-date=2022-04-19 |website=clang.llvm.org |archive-date=2013-07-04 |archive-url=https://web.archive.org/web/20130704124639/http://clang.llvm.org/cxx_status.html |url-status=live }}
  • EDG started implementing C++20 features in version 5.0 and as of version 6.1 supports most C++20 core language features.{{Cite web |title=C++ compiler support - cppreference.com |url=https://en.cppreference.com/w/cpp/compiler_support |website=en.cppreference.com |access-date=2020-10-10 |archive-date=2020-10-03 |archive-url=https://web.archive.org/web/20201003141955/https://en.cppreference.com/w/cpp/compiler_support |url-status=live }}
  • GCC added partial, experimental C++20 support in 2017{{Cite web |title=Andrew Sutton - [PATCH] Add -std=c++2a |url=https://gcc.gnu.org/legacy-ml/gcc-patches/2017-07/msg01234.html |access-date=2022-04-19 |website=gcc.gnu.org |archive-date=2021-03-01 |archive-url=https://web.archive.org/web/20210301065559/https://gcc.gnu.org/legacy-ml/gcc-patches/2017-07/msg01234.html |url-status=live }} in version 8 through the option -std=c++2a. Like Clang, GCC replaced this option with -std=c++20 in version 10. It also has an option to enable GNU extensions in addition to the experimental C++20 support, -std=gnu++20.{{Cite web |title=C++ Standards Support in GCC - GNU Project |url=https://gcc.gnu.org/projects/cxx-status.html |access-date=2022-04-19 |website=gcc.gnu.org |archive-date=2022-04-20 |archive-url=https://web.archive.org/web/20220420114133/https://gcc.gnu.org/projects/cxx-status.html |url-status=live }}

History

Changes applied to the C++20 working draft in July 2017 (Toronto) include:{{cite web|url=https://herbsutter.com/2017/07/15/trip-report-summer-iso-c-standards-meeting-toronto/|title=Trip report: Summer ISO C++ standards meeting (Toronto)|author=Herb Sutter|date=15 July 2017 |access-date=2017-07-16|archive-date=2017-08-06|archive-url=https://web.archive.org/web/20170806182136/https://herbsutter.com/2017/07/15/trip-report-summer-iso-c-standards-meeting-toronto/|url-status=live}}

  • concepts (what made it into the standard is a cut-down version; also described as "Concepts Lite"{{Cite web |title=Concepts Lite: Constraining Templates with Predicates |url=https://isocpp.org/blog/2013/02/concepts-lite-constraining-templates-with-predicates-andrew-sutton-bjarne-s |website=isocpp.org |date=2013-02-24 |author1=Andrew Sutton |author2=Bjarne Stroustrup |access-date=2021-01-13 |archive-date=2021-01-16 |archive-url=https://web.archive.org/web/20210116175846/https://isocpp.org/blog/2013/02/concepts-lite-constraining-templates-with-predicates-andrew-sutton-bjarne-s |url-status=live }})
  • designated initializers
  • [=, this] as a lambda capture
  • template parameter lists on lambdas
  • std::make_shared and std::allocate_shared for arrays

Changes applied to the C++20 working draft in the fall meeting in November 2017 (Albuquerque) include:{{cite web|url=https://herbsutter.com/2017/11/11/trip-report-fall-iso-c-standards-meeting-albuquerque/|title=Trip report: Fall ISO C++ standards meeting (Albuquerque)|author=Herb Sutter|date=11 November 2017 |access-date=2017-12-04|archive-date=2019-02-13|archive-url=https://web.archive.org/web/20190213081959/https://herbsutter.com/2017/11/11/trip-report-fall-iso-c-standards-meeting-albuquerque/|url-status=live}}{{cite web |last1=Smith |first1=Richard |last2=Perchik |first2=Dawn |last3=Köppe |first3=Thomas |title=N4714 Editors' Report -- Programming Languages -- C++ |url=https://github.com/cplusplus/draft/blob/master/papers/n4714.md |website=C++ standards drafts |publisher=GitHub |accessdate=27 December 2018 |archive-date=21 September 2022 |archive-url=https://web.archive.org/web/20220921201419/https://github.com/cplusplus/draft/blob/main/papers/n4714.md |url-status=live }}

  • three-way comparison using the "spaceship operator", operator <=>
  • initialization of an additional variable within a range-based for statement
  • lambdas in unevaluated contexts
  • default constructible and assignable stateless lambdas
  • allow pack expansions in lambda init-capture
  • string literals as template parameters
  • atomic smart pointers (such as std::atomic> and std::atomic>)
  • std::to_address to convert a pointer to a raw pointer

Changes applied to the C++20 working draft in March 2018 (Jacksonville) include:{{cite web|url=https://botondballo.wordpress.com/2018/03/28/trip-report-c-standards-meeting-in-jacksonville-march-2018/|title=Trip Report: C++ Standards Meeting in Jacksonville, March 2018|author=Botond Ballo|date=28 March 2018 |access-date=2019-05-18|archive-date=2019-05-18|archive-url=https://web.archive.org/web/20190518102815/https://botondballo.wordpress.com/2018/03/28/trip-report-c-standards-meeting-in-jacksonville-march-2018/|url-status=live}}

  • removing the need for typename in certain circumstances
  • new standard attributes no_unique_address, likely and unlikely
  • calendar and time-zone additions to
  • std::span, providing a view to a contiguous array (analogous to std::string_view but span can mutate the referenced sequence)
  • header

Changes applied to the C++20 working draft in the summer meeting in June 2018 (Rapperswil) include:{{cite web|url=https://herbsutter.com/2018/07/02/trip-report-summer-iso-c-standards-meeting-rapperswil/|title=Trip report: Summer ISO C++ standards meeting (Rapperswil)|author=Herb Sutter|date=2 July 2018 |access-date=2018-11-10|archive-date=2020-05-23|archive-url=https://web.archive.org/web/20200523083708/https://herbsutter.com/2018/07/02/trip-report-summer-iso-c-standards-meeting-rapperswil/|url-status=live}}

  • contracts (later deferred to a later standard){{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0542r5.html|title=Support for contract based programming in C++|website=www.open-std.org|access-date=2018-11-10|archive-date=2020-01-15|archive-url=https://web.archive.org/web/20200115232059/http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p0542r5.html|url-status=live}}
  • feature test macros
  • bit-casting of object representations, with less verbosity than memcpy() and more ability to exploit compiler internals
  • conditional explicit, allowing the explicit modifier to be contingent on a Boolean expression
  • constexpr virtual functions

Changes applied to the C++20 working draft in the fall meeting in November 2018 (San Diego) include:[http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/n4715.pdf fall meeting in November 2018]

  • ranges (The One Ranges Proposal)
  • concept terse syntax
  • constexpr union, try and catch, dynamic_cast, typeid and std::pointer_traits.
  • various constexpr library bits
  • immediate functions using the new consteval keyword
  • signed integers are now defined to be represented using two's complement (signed integer overflow remains undefined behavior)
  • refinements of the contracts facility (access control in contract conditions){{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1289r0.pdf|title=P1289R0 - Access control in contract conditions|access-date=2018-11-11|archive-date=2018-11-11|archive-url=https://web.archive.org/web/20181111133631/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1289r0.pdf|url-status=live}} (see list of features deferred to a later standard)
  • a revised memory model
  • smart pointer creation with default initialization

Changes applied to the C++20 working draft in the winter meeting in February 2019 (Kona) include:[https://open-std.org/JTC1/SC22/WG21/docs/papers/2018/n4765.pdf winter meeting in February 2019]{{cite web|url=https://www.reddit.com/r/cpp/comments/au0c4x/201902_kona_iso_c_committee_trip_report_c20/|title=r/cpp - 2019-02 Kona ISO C++ Committee Trip Report (C++20 design is complete; Modules in C++20; Coroutines in C++20; Reflection TS v1 published; work begins on a C++ Ecosystem Technical Report)|website=reddit|date=23 February 2019 |language=en|access-date=2019-02-24|archive-date=2019-02-23|archive-url=https://web.archive.org/web/20190223234513/https://www.reddit.com/r/cpp/comments/au0c4x/201902_kona_iso_c_committee_trip_report_c20/|url-status=live}}{{cite web|url=https://herbsutter.com/2019/02/23/trip-report-winter-iso-c-standards-meeting-kona/|title=Trip report: Winter ISO C++ standards meeting (Kona)|date=2019-02-23|website=Sutter's Mill|language=en|access-date=2019-02-24|archive-date=2019-02-24|archive-url=https://web.archive.org/web/20190224030105/https://herbsutter.com/2019/02/23/trip-report-winter-iso-c-standards-meeting-kona/|url-status=live}}

  • coroutines
  • modules
  • various improvements to structured bindings (interaction with lambda captures, static and thread_local storage duration)

Changes applied to the C++20 working draft in the summer meeting in July 2019 (Cologne) include:{{Cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4783.pdf|title=2019 Cologne Meeting Invitation and Information}}{{cite web|url=https://www.reddit.com/r/cpp/comments/cfk9de/201907_cologne_iso_c_committee_trip_report_the/|title=r/cpp - 2019-07 Cologne ISO C++ Committee Trip Report — 🚀 The C++20 Eagle has Landed 🚀 (C++20 Committee Draft shipped; Contracts Moved From C++20 to a Study Group; 'std::format' in C++20; C++20 Synchronization Library)|website=reddit|date=20 July 2019 |language=en|access-date=2019-09-15|archive-date=2020-04-20|archive-url=https://web.archive.org/web/20200420142050/https://www.reddit.com/r/cpp/comments/cfk9de/201907_cologne_iso_c_committee_trip_report_the/|url-status=live}}{{cite web|url=https://botondballo.wordpress.com/2019/07/26/trip-report-c-standards-meeting-in-cologne-july-2019/|title=Trip Report: C++ Standards Meeting in Cologne, July 2019|author=Botond Ballo|date=26 July 2019 |access-date=2019-08-05|archive-date=2020-02-26|archive-url=https://web.archive.org/web/20200226062236/https://botondballo.wordpress.com/2019/07/26/trip-report-c-standards-meeting-in-cologne-july-2019/|url-status=live}}{{cite web|url=https://herbsutter.com/2019/07/20/trip-report-summer-iso-c-standards-meeting-cologne/|title=Trip report: Summer ISO C++ standards meeting (Cologne)|last=Sutter|first=Herb|date=20 July 2019 |access-date=2019-07-21|archive-date=2020-04-17|archive-url=https://web.archive.org/web/20200417181512/https://herbsutter.com/2019/07/20/trip-report-summer-iso-c-standards-meeting-cologne/|url-status=live}}

  • contracts were removed (see list of features deferred to a later standard){{cite web|url=https://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1823r0.pdf|title=P1823R0: Remove Contracts from C++20|last=Josuttis|first=Nicolai|access-date=2019-08-20|archive-date=2020-08-13|archive-url=https://web.archive.org/web/20200813202348/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1823r0.pdf|url-status=live}}
  • use of comma operator in subscript expressions has been deprecated{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1161r2.html|title=P1161R2: Deprecate uses of the comma operator in subscripting expressions|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-07-20|archive-url=https://web.archive.org/web/20190720101000/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1161r2.html|url-status=live}}
  • constexpr additions (trivial default initialization,{{cite web|url=https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1331r1.pdf|title=Permitting trivial default initialization in constexpr contexts|access-date=2019-07-20|archive-date=2020-10-19|archive-url=https://web.archive.org/web/20201019233314/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1331r1.pdf|url-status=live}} unevaluated inline-assembly{{cite web|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1668r1.html|title=P1668R1: Enabling Constexpr Intrinsics By Permitting Unevaluated inline-asm in Constexpr Functions|website=www.open-std.org|access-date=2019-07-20|archive-date=2020-01-19|archive-url=https://web.archive.org/web/20200119114611/http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1668r1.html|url-status=live}})
  • using scoped enums{{cite web|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1099r5.html|title=P1099R5: Using Enum|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001959/http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1099r5.html|url-status=live}}
  • various changes to the spaceship operator{{cite web|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1186r3.html|title=P1186R3: When do you actually use <=>?|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001956/http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1186r3.html|url-status=live}}{{cite web|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1630r1.html|title=P1630R1: Spaceship needs a tune-up|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001956/http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1630r1.html|url-status=live}}
  • DR: minor changes to modules{{cite web|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1766r1.html|title=P1766R1: Mitigating minor modules maladies|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820002001/http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1766r1.html|url-status=live}}
  • constinit keyword
  • changes to concepts (removal of -> Type return-type-requirements{{cite web|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1452r2.html|title=P1452R2: On the non-uniform semantics of return-type-requirements|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001954/http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1452r2.html|url-status=live}})
  • (most of) volatile has been deprecated{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1152r3.html|title=P1152R4: Deprecating volatile|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-06-23|archive-url=https://web.archive.org/web/20190623042109/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1152r3.html|url-status=live}}
  • DR: nodiscard effects on constructors{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1771r1.pdf|title=P1771R1: nodiscard for constructors|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2022-09-21|archive-url=https://web.archive.org/web/20220921201418/https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1771r1.pdf|url-status=live}}
  • The new standard library concepts will not use PascalCase (rather standard_case, as the rest of the standard library){{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf|title=P1754R1: Rename concepts to standard_case for C++20, while we still can|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001957/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1754r1.pdf|url-status=live}}
  • text formatting (std::format, {{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html|title=P0645R10: Text Formatting|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820002001/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0645r10.html|url-status=live}}{{cite web|url=http://www.zverovich.net/2019/07/23/std-format-cpp20.html|title=std::format in C++20|date=2019-07-23|website=www.zverovich.net|access-date=2019-09-15|archive-date=2019-07-23|archive-url=https://web.archive.org/web/20190723193126/http://www.zverovich.net/2019/07/23/std-format-cpp20.html|url-status=live}} chrono integration,{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1361r2.pdf|title=P1361R2: Integration of chrono with text formatting|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820002000/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1361r2.pdf|url-status=live}} corner case fixes{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1652r1.html|title=P1652R1: Printf corner cases in std::format|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001955/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1652r1.html|url-status=live}})
  • bit operations{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html|title=P0553R4: Bit operations|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-07-20|archive-url=https://web.archive.org/web/20190720101004/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0553r4.html|url-status=live}}
  • constexpr INVOKE{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1065r2.html|title=P1965R2: constexpr INVOKE|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001957/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1065r2.html|url-status=live}}
  • math constants{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0631r8.pdf|title=P0631R8: Math Constants|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001958/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0631r8.pdf|url-status=live}}
  • consistency additions to atomics (std::atomic_ref,{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1643r1.html|title=P1643R1: Add wait/notify to atomic_ref<T>|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001955/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1643r1.html|url-status=live}} std::atomic>{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1644r0.html|title=P1664R0: Add wait/notify to atomic|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2021-11-05|archive-url=https://web.archive.org/web/20211105153653/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1644r0.html|url-status=live}})
  • add the <=> operator to the standard library{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html|title=P1614R2: The Mothership has Landed - Adding <=> to the Library|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820002002/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1614r2.html|url-status=live}}
  • header units for the standard library{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1502r1.html|title=P1502R1: Standard library header units for C++20|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001955/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1502r1.html|url-status=live}}
  • synchronization facilities{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html|title=P1135R6: The C++20 Synchronization Library|date=2019-07-20|website=www.open-std.org|access-date=2019-07-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001959/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1135r6.html|url-status=live}} (merged from: Efficient atomic waiting and semaphores,{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0514r4.pdf|title=P0514R4: Efficient concurrent waiting for C++20|publisher=|access-date=2019-07-20|archive-date=2018-08-18|archive-url=https://web.archive.org/web/20180818190437/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0514r4.pdf|url-status=live}} latches and barriers,{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0666r2.pdf|title=P0666R2: Revised Latches and Barriers for C++20|publisher=|access-date=2019-07-20|archive-date=2018-08-18|archive-url=https://web.archive.org/web/20180818190352/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0666r2.pdf|url-status=live}} Improving atomic_flag,{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0995r1.html|title=P0995R1: Improving atomic_flag|publisher=|access-date=2019-07-20|archive-date=2019-07-20|archive-url=https://web.archive.org/web/20190720101004/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0995r1.html|url-status=live}} Don't Make C++ Unimplementable On Small CPUs{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1258r0.html|title=P1285R0: Don't Make C++ Unimplementable On Small CPUs|publisher=|access-date=2019-07-20|archive-date=2019-07-15|archive-url=https://web.archive.org/web/20190715230819/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1258r0.html|url-status=live}})
  • std::source_location{{cite web|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1208r6.pdf|title=P1208R6: Adopt source_location from Library Fundamentals V3 for C++20|access-date=2019-08-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820002002/http://open-std.org/JTC1/SC22/WG21/docs/papers/2019/p1208r6.pdf|url-status=live}}
  • constexpr containers (std::string,{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf|title=P0980R1: Making std::string constexpr|access-date=2020-07-30|archive-date=2020-09-29|archive-url=https://web.archive.org/web/20200929222645/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0980r1.pdf|url-status=live}} std::vector{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.pdf|title=P1004R2: Making std::vector constexpr|access-date=2020-07-30|archive-date=2020-09-28|archive-url=https://web.archive.org/web/20200928192253/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1004r2.pdf|url-status=live}})
  • std::stop_token and joining thread (std::jthread){{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf|title=P0660R10: Stop Token and Joining Thread|access-date=2019-08-20|archive-date=2019-08-20|archive-url=https://web.archive.org/web/20190820001959/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0660r10.pdf|url-status=live}}

Changes applied during the NB comment resolution in the fall meeting in November 2019 (Belfast) include:[https://wg21.link/n4814 fall meeting in November 2019]{{cite web|url=https://www.reddit.com/r/cpp/comments/dtuov8/201911_belfast_iso_c_committee_trip_report/|title=r/cpp - 2019-11 Belfast ISO C++ Committee Trip Report — Started Processing Feedback on the C++20 Committee Draft; ABI Review Group Formed|website=reddit|date=9 November 2019 |language=en-US|access-date=2019-11-09|archive-date=2019-11-09|archive-url=https://web.archive.org/web/20191109121426/https://www.reddit.com/r/cpp/comments/dtuov8/201911_belfast_iso_c_committee_trip_report/|url-status=live}}{{cite web|url=https://herbsutter.com/2019/11/09/trip-report-autumn-iso-c-standards-meeting-belfast/|title=Trip report: Autumn ISO C++ standards meeting (Belfast)|last=Sutter|first=Herb|date=2019-11-09|website=Sutter's Mill|language=en|access-date=2019-11-09|archive-date=2019-11-09|archive-url=https://web.archive.org/web/20191109130530/https://herbsutter.com/2019/11/09/trip-report-autumn-iso-c-standards-meeting-belfast/|url-status=live}}{{cite web|url=https://botondballo.wordpress.com/2019/11/15/trip-report-c-standards-meeting-in-belfast-november-2019/|title=Trip Report: C++ Standards Meeting in Belfast, November 2019|last=botondballo|date=2019-11-15|website=There's Waldo!|language=en|access-date=2019-11-24|archive-date=2019-11-20|archive-url=https://web.archive.org/web/20191120074550/https://botondballo.wordpress.com/2019/11/15/trip-report-c-standards-meeting-in-belfast-november-2019/|url-status=live}}

  • Class Types in Non-Type Template Parameters (NTTP): The restriction of no user-defined operator== allowed has been removed as the meaning of template argument equality has been divorced from operator==.{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1907r0.html|title=P1907R0: Inconsistencies with non-type template parameters|date=2019-10-07|website=www.open-std.org|access-date=2019-11-09|archive-date=2019-11-09|archive-url=https://web.archive.org/web/20191109111420/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1907r0.html|url-status=live}} This allows also for array members in class-type NTTP.
  • Floating-point types,{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1714r1.html|title=P1714: NTTP are incomplete without float, double, and long double! (Revision 1)|date=2019-07-19|website=www.open-std.org|access-date=2019-11-09|archive-date=2019-11-09|archive-url=https://web.archive.org/web/20191109111421/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1714r1.html|url-status=live}} pointers and references and unions and union-like classes (class types containing anonymous unions) are now allowed as NTTP.
  • Function identity now also includes trailing requires-clauses (P1971)
  • Constrained non-template functions have been removed
  • <compare> is now available in freestanding implementations{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1855r0.html|title=P1855R=: Make freestanding|date=2019-10-05|website=www.open-std.org|access-date=2019-11-09|archive-date=2019-11-09|archive-url=https://web.archive.org/web/20191109111422/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1855r0.html|url-status=live}}
  • std::spans typedef was changed from index_type to size_type to be consistent with the rest of the standard library{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1872r0.pdf|title=P1872R0: span should have size_type not index_type|date=2019-09-16|website=www.open-std.org|access-date=2019-11-09|archive-date=2019-11-09|archive-url=https://web.archive.org/web/20191109111423/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1872r0.pdf|url-status=live}}
  • Concept traits have been renamed to follow the renaming of the concepts as a result from the Cologne meeting
  • Several fixes and additions to ranges (P1456R1: Move-only views,{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1456r0.pdf|title=P1456: Move-only views|date=2019-01-25|website=www.open-std.org|access-date=2019-11-09|archive-date=2019-11-09|archive-url=https://web.archive.org/web/20191109111425/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1456r0.pdf|url-status=live}} P1391R4: Range constructor for std::string_view (constructor from iterator-pair of characters),{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1391r4.pdf|title=P1391: Range constructor for std::string_view|date=|website=www.open-std.org|access-date=2019-11-09|archive-date=2020-01-04|archive-url=https://web.archive.org/web/20200104215539/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1391r4.pdf|url-status=live}} P1394R4: Range constructor for std::span<ref>,{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1394r3.pdf|title=P1394: Range constructor for std::span|date=2019-08-02|website=www.open-std.org|access-date=2019-11-09|archive-date=2019-11-09|archive-url=https://web.archive.org/web/20191109111421/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1394r3.pdf|url-status=live}} P1870R1: forwarding-range<T> is too subtle{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1870r0.html|title=P1870R1: forwarding-range<T> is too subtle|date=6 October 2019|website=www.open-std.org|access-date=2019-11-09|archive-date=2019-11-09|archive-url=https://web.archive.org/web/20191109111421/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1870r0.html|url-status=live}})
  • Initialization for std::atomic has been changed to make it work with default and list initialization,{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0883r1.pdf|title=P0883: Fixing Atomic Initialization|date=2018-06-05|website=www.open-std.org|access-date=2019-11-09|archive-date=2019-11-09|archive-url=https://web.archive.org/web/20191109111419/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0883r1.pdf|url-status=live}} std::latch and std::barrier can now report the maximum number of threads that the implementation supports through the new member function max()
  • std::weak_equality and std::strong_equality have been removed as they are not used anymore
  • Algorithms in <numeric> have been made constexpr
  • Missing feature-test macros for new or changed features of C++20 have been added{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1902r0.html|title=Missing feature-test macros 2018-2019|date=2019-10-06|website=www.open-std.org|access-date=2019-11-09|archive-date=2019-11-09|archive-url=https://web.archive.org/web/20191109111423/http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1902r0.html|url-status=live}}

References

{{reflist}}