C++17
C++17 (also called C++1z) is the informal name for the future revision of the C++ ISO/IEC standard. The specification for the C++17 revision is under development and "nearly feature-complete"[1] to be finished in 2017.
Expected features
- Addition of a default text message for
static_assert
[2] - Addition of
std::string_view
, a non-owning reference to a character sequence or string-slice[3] - Removal of trigraphs[4][5]
- Allow
typename
in a template template parameter[6] - New rules for
auto
deduction from braced-init-list[7][8] std::uncaught_exceptions
, as a replacement ofstd::uncaught_exception
[9][10]- Nested namespace definition[8][11]
- Attributes for namespaces and enumerators[10][12]
- UTF-8 character literals[10][13]
- Constant evaluation for all non-type template arguments[10][14]
- Folding expressions[10][15]
- New insertion functions for
std::map
andstd::unordered_map
[16][17] - Uniform container access[17][18]
- Definition of "contiguous iterators"[17][19]
- Removal of some deprecated types and functions like
std::auto_ptr
,std::random_shuffle
or old function adaptors[20][8] - A file system library based on
boost::filesystem
[21] - Parallel versions of STL algorithms[22]
- Additional mathematical special functions[23]
- Most of Library Fundamentals TS I (e.g.
std::optional
,std::any
)[24][25] std::variant
, a type-safe union container- A compile-time static
if
with the formif constexpr(expression)
- Structured bindings, allowing
auto [a, b] = getTwoReturnValues();
- Initializers in
if
andswitch
statements - Guaranteed copy elision by compilers in some cases
- Some extensions on aligned memory allocation
- Template deduction of constructors, allowing
pair(5.0, false)
instead ofpair<double,bool>(5.0, false)
- Inline variables, which allows the declaration of variables in header files
Next standard
- C++20[26]
See also
References
- ↑ Recent milestones: C++17 nearly feature-complete, second round of TSes now under development
- ↑ "N3928: Extending static_assert, v2 (Walter E. Brown)" (PDF).
- ↑ "std::basic_string_view - cppreference.com". en.cppreference.com. Retrieved 2016-06-23.
- ↑ "N3981: Removing trigraphs??! (Richard Smith)". 2014-05-06.
- ↑ IBM comment on preparing for a Trigraph-adverse future in C++17, IBM paper N4210, 2014-10-10. Authors: Michael Wong, Hubert Tong, Rajan Bhakta, Derek Inglis
- ↑ "N4051: Allow typename in a template template parameter (Richard Smith)".
- ↑ "N3922: New Rules for auto deduction from braced-init-list (James Dennett)".
- 1 2 3 "Updates to my trip report".
- ↑ "N4259: Wording for std::uncaught_exceptions (Herb Sutter)" (PDF).
- 1 2 3 4 5 "New core language papers adopted for C++17".
- ↑ "N4230: Nested namespace definition (Robert Kawulak, Andrew Tomazos)".
- ↑ "N4266: Attributes for namespaces and enumerators (Richard Smith)".
- ↑ "N4267: Adding u8 character literals (Richard Smith)".
- ↑ "N4268: Allow constant evaluation for all non-type template arguments (Richard Smith)".
- ↑ "N4295: Folding expressions (Andrew Sutton, Richard Smith)".
- ↑ "N4279: Improved insertion interface for unique-key maps (Thomas Köppe)".
- 1 2 3 "New standard library papers adopted for C++17".
- ↑ "N4280: Non-member size() and more (Riccardo Marcangelo)" (PDF).
- ↑ "N4284: Contiguous Iterators (Jens Maurer)".
- ↑ "N4190: Removing auto_ptr, random_shuffle(), And Old <functional> Stuff (Stephan T. Lavavej)".
- ↑ "Filesystem Library Proposal (Beman Dawes)".
- ↑ "The Parallelism TS Should be Standardized".
- ↑ "Mathematical Special Functions for C++17, v5" (PDF).
- ↑ "Adopt Library Fundamentals V1 TS Components for C++17 (R1)".
- ↑ "Current Status".
- ↑ https://herbsutter.com/2016/06/30/trip-report-summer-iso-c-standards-meeting-oulu/ "the next standard after C++17 will be C++20"
This article is issued from Wikipedia - version of the 11/30/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.