Вы находитесь на странице: 1из 5

21/5/2019 C++20 - Wikipedia

C++20
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 N4810.[3]

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

Contents
New features
Possible new features
Possible library changes
Features deferred to a later standard
See also
References
External links

New features
Features voted into the C++20 draft in July 2017 (Toronto) include:[5]

concepts[6]
designated initializers[7] (based on the C99 feature)
[=, this] as a lambda capture[8]
template parameter lists on lambdas[9]
Features voted into C++20 in the fall meeting in November 2017 (Albuquerque) include:[10][11]

three-way comparison using the "spaceship operator", operator <=>


initialization of an additional variable within a range-based for statement
lambdas in unevaluated contexts[12][13]
default constructible and assignable stateless lambdas[12][14]
allow pack expansions in lambda init-capture[12][15]
string literals as template parameters[12][16]
atomic smart pointers (such as std::atomic<shared_ptr<T>> and std::atomic<weak_ptr<T>>)[17]
Features voted into C++20 in March 2018 (Jacksonville) include:[18]

removing the need for typename in certain circumstances[19]


new standard attributes [[likely]] and [[unlikely]][20]
calendar and time-zone additions to <chrono>[21]
std::span, providing a view of a contiguous array (analogous to std::string_view)[22]
<version> header[23]
Features voted into C++20 in the summer meeting in June 2018 (Rapperswil) include:[24]

contracts[25]
feature test macros[26]

https://en.wikipedia.org/wiki/C%2B%2B20 1/5
21/5/2019 C++20 - Wikipedia

bit-casting of object representations, with less verbosity than memcpy() and more ability to exploit compiler
internals[27]
conditional explicit, allowing the explicit modifier to be contingent on a boolean expression[28]
constexpr virtual functions[29]
Features voted into C++20 in the fall meeting in November 2018 (http://open-std.org/JTC1/SC22/WG21/docs/paper
s/2018/n4715.pdf) (San Diego) include:

ranges (The One Ranges Proposal)[30]


concept terse syntax[31]
constexpr union,[32] try and catch[33] dynamic_cast and typeid,[34] std::pointer_traits[35]
various constexpr library bits[36]
immediate functions using the new consteval keyword[37]
signed integers are now defined to be represented using two's complement (signed integer overflow remains
undefined behavior)[38]
refinements of the contracts facility (access control in contract conditions)[39]
a revised memory model[40]
Features voted into C++20 in the winter meeting in February 2019 (http://open-std.org/JTC1/SC22/WG21/docs/pap
ers/2018/n4765.pdf) (Kona) include:[41] [42]

coroutines[43] – already experimentally supported in Clang 5[44]


modules[45] – experimentally supported in Clang 5[46] and Visual Studio 2015 Update 1[47] as well as GCC[48]
various improvements to structured bindings (interaction with lambda captures, static and thread_local storage
duration)[49] [50]

Possible new features


transactional memory[51]

Possible library changes


extended futures[52]
latches and barriers[53]
task blocks[54]
text formatting[55]

Features deferred to a later standard


Reflection[56][57]
Metaclasses[58]
Executors[59]
Networking extensions,[60][61] including async, basic I/O services, timers, buffers and buffer-oriented streams,
sockets, and Internet protocols (blocked by executors)
Properties[62]

See also
C++
C++98
C++03
C++11
C++14

https://en.wikipedia.org/wiki/C%2B%2B20 2/5
21/5/2019 C++20 - Wikipedia

C++17
C11 (C standard revision)
C18 (C standard revision)

References
1. "The next standard after C++17 will be C++20" (https://herbsutter.com/2016/06/30/trip-report-summer-iso-c-stand
ards-meeting-oulu/)., by Herb Sutter
2. "Current Status : Standard C++" (https://isocpp.org/std/status).
3. "Working Draft, Standard for Programming Language C++" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/
2019/n4810.pdf) (PDF).
4. "P0592R0: To boldly suggest an overall plan for C++20" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/201
7/p0592r0.html).
5. Herb Sutter. "Trip report: Summer ISO C++ standards meeting (Toronto)" (https://herbsutter.com/2017/07/15/trip-r
eport-summer-iso-c-standards-meeting-toronto/).
6. "P0606R0: Concepts Are Ready" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0606r0.pdf) (PDF).
7. Tim Shen; Richard Smith. "Designated Initialization Wording" (https://wg21.link/p0329).
8. Thomas Köppe. "Allow lambda capture [=, this]" (https://wg21.link/p0409).
9. "Familiar template syntax for generic lambdas" (https://wg21.link/p0428).
10. Herb Sutter. "Trip report: Fall ISO C++ standards meeting (Albuquerque)" (https://herbsutter.com/2017/11/11/trip-r
eport-fall-iso-c-standards-meeting-albuquerque/).
11. Smith, Richard; Perchik, Dawn; Köppe, Thomas. "N4714 Editors' Report -- Programming Languages -- C++" (http
s://github.com/cplusplus/draft/blob/master/papers/n4714.md). C++ standards drafts. GitHub. Retrieved
27 December 2018.
12. "Trip Report: C++ Standards Meeting in Albuquerque, November 2017" (https://botondballo.wordpress.com/2017/
11/20/trip-report-c-standards-meeting-in-albuquerque-november-2017/). There's Waldo!. 2017-11-20. Retrieved
2017-12-11.
13. "Wording for lambdas in unevaluated contexts" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0315r
4.pdf) (PDF).
14. "Default constructible and assignable stateless lambdas" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/20
17/p0624r2.pdf) (PDF).
15. "Pack expansion in lambda init-capture" (http://www.open-
std.org/jtc1/sc22/wg21/docs/papers/2017/p0780r0.html). www.open-std.org. Retrieved 2017-12-11.
16. "String literals as non-type template parameters" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p042
4r2.pdf) (PDF).
17. Meredith, Alisdair; Sutter, Herb. "Revising atomic_shared_ptr for C++20" (http://www.open-std.org/jtc1/sc22/wg21/
docs/papers/2017/p0718r2.html). JTC1/SC22/WG21 - The C++ Standards Committee - ISOCPP. ISO. Retrieved
27 December 2018.
18. Botond Ballo. "Trip Report: C++ Standards Meeting in Jacksonville, March 2018" (https://botondballo.wordpress.c
om/2018/03/28/trip-report-c-standards-meeting-in-jacksonville-march-2018/).
19. Nina Ranns; Daveed Vandevoorde. "Down with typename!" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/
2018/p0634r3.html).
20. "Proposed wording for likely and unlikely attributes (Revision 5)" (http://www.open-std.org/jtc1/sc22/wg21/docs/pa
pers/2018/p0479r5.html).
21. Howard E. Hinnant; Tomasz Kamiński. "Extending <chrono> to Calendars and Time Zones" (http://www.open-std.
org/jtc1/sc22/wg21/docs/papers/2018/p0355r7.html).
22. Neil MacIntosh; Stephan T. Lavavej. "span: bounds-safe views for sequences of objects" (http://wg21.link/p0122).
23. Alan Talbot. "<version>" (http://wg21.link/p0754).
24. Herb Sutter. "Trip report: Summer ISO C++ standards meeting (Rapperswil)" (https://herbsutter.com/2018/07/02/tr
ip-report-summer-iso-c-standards-meeting-rapperswil/).
25. "Support for contract based programming in C++" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p05
42r5.html). www.open-std.org. Retrieved 2018-11-10.
https://en.wikipedia.org/wiki/C%2B%2B20 3/5
21/5/2019 C++20 - Wikipedia

26. "Integrating feature-test macros into the C++ WD" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p09


41r2.html). www.open-std.org. Retrieved 2018-11-10.
27. "Bit-casting object representations" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0476r2.html).
www.open-std.org. Retrieved 2018-11-10.
28. "explicit(bool)" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0892r2.html). www.open-std.org.
Retrieved 2018-11-13.
29. "Allowing Virtual Function Calls in Constant Expressions" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/20
18/p1064r0.html). www.open-std.org. Retrieved 2019-03-11.
30. "P0896R3" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r3.pdf) (PDF).
31. "P1141R1 - Yet another approach for constrained declarations" (http://open-std.org/JTC1/SC22/WG21/docs/paper
s/2018/p1141r1.html).
32. "P1330R0 - Changing the active member of a union inside constexpr" (http://wiki.edg.com/pub/Wg21sandiego201
8/StrawPolls/p1330r0.pdf) (PDF).
33. "P1002R0 - Try-catch blocks in constexpr functions" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p
1002r0.pdf) (PDF).
34. "P1327R0 - Allowing dynamic_cast, polymorphic typeid in Constant Expressions" (http://wiki.edg.com/pub/Wg21s
andiego2018/EvolutionWorkingGroup/P1327R0.html).
35. "P1006R1 - Constexpr in std::pointer_traits" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1006r1.p
df) (PDF).
36. "P1032R1 - Misc constexpr bits" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html).
37. "P1073R2 - Immediate functions" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r2.html).
38. "P1236R0: Alternative Wording for P0907R4 Signed Integers are Two's Complement" (http://www.open-std.org/jtc
1/sc22/wg21/docs/papers/2018/p1236r0.html).
39. "P1289R0 - Access control in contract conditions" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p12
89r0.pdf) (PDF).
40. "P0668R4: Revising the C++ memory model" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0668r
4.html).
41. "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)" (https://w
ww.reddit.com/r/cpp/comments/au0c4x/201902_kona_iso_c_committee_trip_report_c20/). reddit. Retrieved
2019-02-24.
42. "Trip report: Winter ISO C++ standards meeting (Kona)" (https://herbsutter.com/2019/02/23/trip-report-winter-iso-c
-standards-meeting-kona/). Sutter’s Mill. 2019-02-23. Retrieved 2019-02-24.
43. "N4649: Working Draft, Technical Specification on C++ Extensions for Coroutines" (http://www.open-std.org/jtc1/s
c22/wg21/docs/papers/2017/n4649.pdf) (PDF).
44. "Clang 5 Release Notes on coroutines" (http://releases.llvm.org/5.0.2/tools/clang/docs/ReleaseNotes.html#c-coro
utines).
45. "N4720: Working Draft, Extensions to C++ for Modules" (https://isocpp.org/files/papers/n4720.pdf) (PDF).
46. "Clang 5 documentation on Modules" (https://clang.llvm.org/docs/Modules.html).
47. "C++ Modules in VS 2015 Update 1" (https://blogs.msdn.microsoft.com/vcblog/2015/12/03/c-modules-in-vs-2015-
update-1/).
48. "cxx-modules - GCC Wiki" (https://gcc.gnu.org/wiki/cxx-modules). gcc.gnu.org. Retrieved 2019-02-24.
49. "P1091R1: Extending structured bindings to be more like variable declarations" (http://www.open-std.org/jtc1/sc2
2/wg21/docs/papers/2018/p1091r1.html). www.open-std.org. Retrieved 2019-02-24.
50. "P1091R2: Extending structured bindings to be more like variable declarations" (http://www.open-std.org/jtc1/sc2
2/wg21/docs/papers/2018/p1091r2.html). www.open-std.org. Retrieved 2019-02-24.
51. "N3341: Transactional Language Constructs for C++" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/
n3341.pdf) (PDF).
52. "Functional in C++17 and C++20" (http://www.modernescpp.com/index.php/functional-in-c-17-and-c-20).
53. "P0342R0: Timing barriers" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0342r0.html).
54. "Task Blocks" (http://www.modernescpp.com/index.php/task-blocks).

https://en.wikipedia.org/wiki/C%2B%2B20 4/5
21/5/2019 C++20 - Wikipedia

55. "Text Formatting" (http://fmtlib.net/Text%20Formatting.html).


56. "Reflections on the reflection proposals - Meeting C++" (https://meetingcpp.com/index.php/br/items/reflections-on-
the-reflection-proposals.html). meetingcpp.com. Retrieved 2017-06-30.
57. "Static reflection" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0194r6.html). www.open-std.org.
Retrieved 2018-11-10.
58. Herb Sutter. "Metaclasses" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0707r0.pdf) (PDF).
59. "A Unified Executors Proposal for C++" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0443r10.htm
l). www.open-std.org. Retrieved 2019-02-24.
60. "N4771: Working Draft, C++ Extensions for Networking" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/201
8/n4771.pdf) (PDF).
61. "ISO/IEC TS 19216:2018 Programming Languages -- C++ Extensions for Networking" (https://www.iso.org/standa
rd/64030.html).
62. "A General Property Customization Mechanism" (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p139
3r0.html). www.open-std.org. Retrieved 2019-02-24.

External links
JTC1/SC22/WG21 (http://www.open-std.org/jtc1/sc22/wg21/) – the ISO/IEC C++ Standard Working Group (a.k.a.
the C++ Standards Committee)
Ranges (range-v3 (https://github.com/ericniebler/range-v3)) github repository, by Eric Niebler

Retrieved from "https://en.wikipedia.org/w/index.php?title=C%2B%2B20&oldid=897632341"

This page was last edited on 18 May 2019, at 10:49 (UTC).

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using
this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia
Foundation, Inc., a non-profit organization.

https://en.wikipedia.org/wiki/C%2B%2B20 5/5

Вам также может понравиться