请输入您要查询的百科知识:

 

词条 C++20
释义

  1. New features

  2. Possible new features

  3. Possible library changes

  4. Features deferred to a later standard

  5. See also

  6. References

  7. External links

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 N4778.[3]

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

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> and std::atomic>)[17]

Features voted into C++20 in the summer meeting in June 2018 (Rapperswil) include:[18]

  • contracts[19]
  • feature test macros[20]
  • bit-casting of object representations, with less verbosity than memcpy() and more ability to exploit compiler internals[21]
  • conditional explicit, allowing the explicit modifier to be contingent on a boolean expression[22]
  • constexpr virtual functions[23]

Features voted into C++20 in the fall meeting in November 2018 (San Diego) include:

  • ranges (The One Ranges Proposal)[24]
  • concept terse syntax[25]
  • constexpr union,[26] try and catch[27] dynamic_cast and typeid,[28] std::pointer_traits[29]
  • various constexpr library bits[30]
  • immediate functions using the new consteval keyword[31]
  • signed integers are now defined to be represented using two's complement (signed integer overflow remains undefined behavior)[32]
  • refinements of the contracts facility (access control in contract conditions)[33]
  • a revised memory model[34]

Features voted into C++20 in the winter meeting in February 2019 (Kona) include:[35] [36]

  • coroutines[37]{{snd}} already experimentally supported in Clang 5[38]
  • modules[39]{{snd}} experimentally supported in Clang 5[40] and Visual Studio 2015 Update 1[41] as well as GCC[42]
  • various improvements to structured bindings (interaction with lambda captures, static and thread_local storage duration)[43] [44]

Possible new features

  • transactional memory[45]

Possible library changes

  • extended futures[46]
  • latches and barriers[47]
  • task blocks[48]
  • text formatting[49]

Features deferred to a later standard

  • reflection[50][51]
  • metaclasses[52]
  • executors [53]
  • networking extensions,[54][55] including async, basic I/O services, timers, buffers and buffer-oriented streams, sockets, and Internet protocols (blocked by executors)
  • properties[56]

See also

  • C++
  • C++98
  • C++03
  • C++11
  • C++14
  • C++17
  • C11 (C standard revision)
  • C18 (C standard revision)

References

1. ^{{cite web|url=https://herbsutter.com/2016/06/30/trip-report-summer-iso-c-standards-meeting-oulu/|title=The next standard after C++17 will be C++20|publisher=}}, by Herb Sutter
2. ^{{cite web|url=https://isocpp.org/std/status|title=Current Status : Standard C++|publisher=}}
3. ^{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4778.pdf|title=Working Draft, Standard for Programming Language C++}}
4. ^{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0592r0.html|title=P0592R0: To boldly suggest an overall plan for C++20|publisher=}}
5. ^{{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}}
6. ^{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0606r0.pdf|title=P0606R0: Concepts Are Ready|publisher=}}
7. ^{{cite web|url=https://wg21.link/p0329|title=Designated Initialization Wording|author1=Tim Shen|author2=Richard Smith}}
8. ^{{cite web|url=https://wg21.link/p0409|title=Allow lambda capture [=, this]|author=Thomas Köppe}}
9. ^{{cite web|url=https://wg21.link/p0428|title=Familiar template syntax for generic lambdas}}
10. ^{{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}}
11. ^{{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}}
12. ^{{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}}
13. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0315r4.pdf|title=Wording for lambdas in unevaluated contexts|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
14. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0624r2.pdf|title=Default constructible and assignable stateless lambdas|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
15. ^{{Cite web|url=http://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}}
16. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0424r2.pdf|title=String literals as non-type template parameters|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
17. ^{{cite web |last1=Meredith |first1=Alisdair |last2=Sutter |first2=Herb |title=Revising atomic_shared_ptr for C++20 |url=http://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}}
18. ^{{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}}
19. ^{{Cite web|url=http://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}}
20. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0941r2.html|title=Integrating feature-test macros into the C++ WD|website=www.open-std.org|access-date=2018-11-10}}
21. ^{{Cite web|url=http://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}}
22. ^{{Cite web|url=http://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}}
23. ^{{Cite web|url=http://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}}
24. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0896r3.pdf|title=P0896R3|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
25. ^{{Cite web|url=http://open-std.org/JTC1/SC22/WG21/docs/papers/2018/p1141r1.html|title=P1141R1 - Yet another approach for constrained declarations|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
26. ^{{Cite web|url=http://wiki.edg.com/pub/Wg21sandiego2018/StrawPolls/p1330r0.pdf|title=P1330R0 - Changing the active member of a union inside constexpr|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
27. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1002r0.pdf|title=P1002R0 - Try-catch blocks in constexpr functions|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
28. ^{{Cite web|url=http://wiki.edg.com/pub/Wg21sandiego2018/EvolutionWorkingGroup/P1327R0.html|title=P1327R0 - Allowing dynamic_cast, polymorphic typeid in Constant Expressions|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
29. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1006r1.pdf|title=P1006R1 - Constexpr in std::pointer_traits|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
30. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1032r1.html|title=P1032R1 - Misc constexpr bits|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
31. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1073r2.html|title=P1073R2 - Immediate functions|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
32. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1236r0.html|title=P1236R0: Alternative Wording for P0907R4 Signed Integers are Two's Complement|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
33. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1289r0.pdf|title=P1289R0 - Access control in contract conditions|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
34. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0668r4.html|title=P0668R4: Revising the C++ memory model|last=|first=|date=|website=|archive-url=|archive-date=|dead-url=|access-date=}}
35. ^{{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|language=en|access-date=2019-02-24}}
36. ^{{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}}
37. ^{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4649.pdf|title=N4649: Working Draft, Technical Specification on C++ Extensions for Coroutines|publisher=}}
38. ^{{cite web|url=http://releases.llvm.org/5.0.2/tools/clang/docs/ReleaseNotes.html#c-coroutines|title=Clang 5 Release Notes on coroutines|publisher=}}
39. ^{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4637.pdf|title=N4637: Working Draft, Extensions to C++ for Modules|publisher=}}
40. ^{{cite web|url=https://clang.llvm.org/docs/Modules.html|title=Clang 5 documentation on Modules|publisher=}}
41. ^{{cite web|url=https://blogs.msdn.microsoft.com/vcblog/2015/12/03/c-modules-in-vs-2015-update-1/|title=C++ Modules in VS 2015 Update 1|publisher=}}
42. ^{{Cite web|url=https://gcc.gnu.org/wiki/cxx-modules|title=cxx-modules - GCC Wiki|website=gcc.gnu.org|access-date=2019-02-24}}
43. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1091r1.html|title=P1091R1: Extending structured bindings to be more like variable declarations|last=|first=|date=|website=www.open-std.org|archive-url=|archive-date=|dead-url=|access-date=2019-02-24}}
44. ^{{Cite web|url=http://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}}
45. ^{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3341.pdf|title=N3341: Transactional Language Constructs for C++|publisher=}}
46. ^{{cite web|url=http://www.modernescpp.com/index.php/functional-in-c-17-and-c-20|title=Functional in C++17 and C++20}}
47. ^{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0342r0.html|title=P0342R0: Timing barriers|publisher=}}
48. ^{{cite web|url=http://www.modernescpp.com/index.php/task-blocks|title=Task Blocks|publisher=}}
49. ^{{cite web|url=http://fmtlib.net/Text%20Formatting.html|title=Text Formatting|publisher=}}
50. ^{{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}}
51. ^{{Cite web|url=http://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}}
52. ^{{cite-web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0707r0.pdf|title=Metaclasses|author=Herb Sutter}}
53. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0443r10.html|title=A Unified Executors Proposal for C++|last=|first=|date=|website=www.open-std.org|archive-url=|archive-date=|dead-url=|access-date=2019-02-24}}
54. ^{{cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/n4771.pdf|title=N4771: Working Draft, C++ Extensions for Networking|publisher=}}
55. ^{{cite web|url=https://www.iso.org/standard/64030.html|title=ISO/IEC TS 19216:2018 Programming Languages -- C++ Extensions for Networking|publisher=}}
56. ^{{Cite web|url=http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1393r0.html|title=A General Property Customization Mechanism|last=|first=|date=|website=www.open-std.org|archive-url=|archive-date=|dead-url=|access-date=2019-02-24}}

External links

  • JTC1/SC22/WG21{{snd}} the ISO/IEC C++ Standard Working Group (a.k.a. the C++ Standards Committee)
  • Ranges ([https://github.com/ericniebler/range-v3 range-v3]) github repository, by Eric Niebler
{{C++ProLang}}

2 : C++|Programming language standards

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/11/13 11:31:23