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

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

Possible new language features

The following were voted into the C++20 draft in July 2017:[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 include:[10]

  • Three-way comparison using the "spaceship operator", operator <=>
  • Initialization of an additional variable within a range-based for statement
  • Bit-casting of object representations, with less verbosity than memcpy() and more ability to exploit compiler internals
  • A specialization of std::atomic for std::shared_ptr
  • Lambdas in unevaluated contexts.[11][12]
  • Default constructible and assignable stateless lambdas.[11][13]
  • Allow pack expansions in lambda init-capture.[11][14]
  • String literals as template parameters.[11][15]

Other possible new language features:

Possible library changes

  • Atomic smart pointers[24] (std::atomic_shared_ptr and std::atomic_weak_ptr)
  • Extended futures[25]
  • Latches and barriers[26]
  • Networking extensions,[27] including async, basic I/O services, timers, buffers and buffer-oriented streams, sockets, and Internet protocols
  • Ranges[28]
  • Task blocks[29]

See also

References

  1. "The next standard after C++17 will be C++20". , by Herb Sutter
  2. "Current Status : Standard C++".
  3. "Working Draft, Standard for Programming Language C++" (PDF).
  4. "P0592R0: To boldly suggest an overall plan for C++20".
  5. Herb Sutter. "Trip report: Summer ISO C++ standards meeting (Toronto)".
  6. "P0606R0: Concepts Are Ready" (PDF).
  7. Tim Shen; Richard Smith. "Designated Initialization Wording".
  8. Thomas Köppe. "Allow lambda capture [=, this]".
  9. "Familiar template syntax for generic lambdas".
  10. Herb Sutter. "Trip report: Fall ISO C++ standards meeting (Albuquerque)".
  11. 1 2 3 4 "Trip Report: C++ Standards Meeting in Albuquerque, November 2017". There's Waldo!. 2017-11-20. Retrieved 2017-12-11.
  12. "Wording for lambdas in unevaluated contexts" (PDF).
  13. "Default constructible and assignable stateless lambdas" (PDF).
  14. "Pack expansion in lambda init-capture". www.open-std.org. Retrieved 2017-12-11.
  15. "String literals as non-type template parameters" (PDF).
  16. "N4649: Working Draft, Technical Specification on C++ Extensions for Coroutines" (PDF).
  17. "Clang 5 Release Notes on coroutines".
  18. "N4637: Working Draft, Extensions to C++ for Modules" (PDF).
  19. "Clang 5 documentation on Modules".
  20. "C++ Modules in VS 2015 Update 1".
  21. "N3341: Transactional Language Constructs for C++" (PDF).
  22. "Reflections on the reflection proposals - Meeting C++". meetingcpp.com. Retrieved 2017-06-30.
  23. Herb Sutter. "Metaclasses" (PDF).
  24. "Atomic Smart Pointers".
  25. "Functional in C++17 and C++20".
  26. "P0342R0: Timing barriers".
  27. "N4734: Working Draft, C++ Extensions for Networking" (PDF).
  28. "N4651: Working Draft, C++ Extensions for Ranges" (PDF).
  29. "Task Blocks".
  • JTC1/SC22/WG21  the ISO/IEC C++ Standard Working Group (a.k.a. the C++ Standards Committee)
  • Ranges (range-v3) github repository, by Eric Niebler
This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.