|
| 1 | +%!TEX root = std.tex |
| 2 | +\chapter{Foreword} |
| 3 | + |
| 4 | +ISO (the International Organization for Standardization) and IEC (the |
| 5 | +International Electrotechnical Commission) form the specialized system for |
| 6 | +worldwide standardization. National bodies that are members of ISO or IEC |
| 7 | +participate in the development of International Standards through technical |
| 8 | +committees established by the respective organization to deal with particular |
| 9 | +fields of technical activity. ISO and IEC technical committees collaborate in |
| 10 | +fields of mutual interest. Other international organizations, governmental and |
| 11 | +non-governmental, in liaison with ISO and IEC, also take part in the work. |
| 12 | + |
| 13 | +The procedures used to develop this document and those intended for its further |
| 14 | +maintenance are described in the ISO/IEC Directives, Part 1. In particular the |
| 15 | +different approval criteria needed for the different types of documents should |
| 16 | +be noted. This document was drafted in accordance with the editorial rules of |
| 17 | +the ISO/IEC Directives, Part 2 |
| 18 | +(see \href{http://www.iso.org/directives}{\tcode{www.iso.org/directives}}). |
| 19 | + |
| 20 | +Attention is drawn to the possibility that some of the elements of this |
| 21 | +document may be the subject of patent rights. ISO and IEC shall not be held |
| 22 | +responsible for identifying any or all such patent rights. Details of any |
| 23 | +patent rights identified during the development of the document will be in the |
| 24 | +Introduction and/or on the ISO list of patent declarations received |
| 25 | +(see \href{http://www.iso.org/patents}{\tcode{www.iso.org/patents}}) |
| 26 | +or the IEC list of patent declarations received |
| 27 | +(see \href{http://patents.iec.ch}{\tcode{http://patents.iec.ch}}). |
| 28 | + |
| 29 | +Any trade name used in this document is information given for the convenience |
| 30 | +of users and does not constitute an endorsement. |
| 31 | + |
| 32 | +For an explanation on |
| 33 | +the voluntary nature of standards, |
| 34 | +the meaning of ISO specific terms and expressions related |
| 35 | +to conformity assessment, as well as information about ISO's adherence |
| 36 | +to the World Trade Organization (WTO) principles |
| 37 | +in the Technical Barriers to Trade (TBT) see the following URL: |
| 38 | +\href{http://www.iso.org/iso/foreword.html}{\tcode{www.iso.org/iso/foreword.html}}. |
| 39 | + |
| 40 | +This document was prepared by |
| 41 | +Joint Technical Committee ISO/IEC JTC 1, \textit{Information technology}, |
| 42 | +Subcommittee SC 22, \textit{Programming languages, their environments and system software interfaces}. |
| 43 | + |
| 44 | +This sixth edition cancels and replaces the fifth edition |
| 45 | +(ISO/IEC 14882:2017), which has been technically revised. |
| 46 | +It also incorporates the Technical Specifications |
| 47 | +\begin{itemize} |
| 48 | +\item ISO/IEC TS 19217:2015 \textit{Programming Languages --- \Cpp{} Extensions for concepts}, |
| 49 | +\item ISO/IEC TS 21425:2017 \textit{Programming Languages --- \Cpp{} Extensions for ranges}, |
| 50 | +\item ISO/IEC TS 22277:2017 \textit{Programming Languages --- \Cpp{} Extensions for Coroutines}, |
| 51 | +\item ISO/IEC TS 21544:2018 \textit{Programming Languages --- Extensions to \Cpp{} for Modules}, |
| 52 | +\item portions of ISO/IEC TS 19571:2016 \textit{Programming Languages --- Technical specification for \Cpp{} extensions for concurrency}, and % latch and barrier |
| 53 | +\item portions of ISO/IEC TS 19568:2017 \textit{Programming Languages --- \Cpp{} Extensions for Library Fundamentals}. |
| 54 | +\end{itemize} |
| 55 | + |
| 56 | +The main changes compared to the previous edition are as follows: |
| 57 | + |
| 58 | +\begin{itemize} |
| 59 | +% language changes |
| 60 | +\item addition of concepts, \grammarterm{requires-clause}s, and \grammarterm{requires-expression}s and |
| 61 | +\libheaderref{concepts} header |
| 62 | +\item addition of coroutines, including |
| 63 | +\keyword{co_yield}, \keyword{co_await}, and \keyword{co_return} keywords and |
| 64 | +\libheaderref{coroutine} header |
| 65 | +\item addition of modules, \grammarterm{import-declaration}s, and \grammarterm{export-declaration}s |
| 66 | +\item addition of three-way comparison, defaulted comparisons, |
| 67 | +rewriting of comparison operator expressions, and \libheaderref{compare} header |
| 68 | +\item addition of designated initializers |
| 69 | +\item support for class types and floating-point types as the type of a non-type template parameter |
| 70 | +\item new attributes \tcode{[[no_unique_address]]}, \tcode{[[likely]]}, \tcode{[[unlikely]]} |
| 71 | +\item support for optional reason string in \tcode{[[nodiscard]]} attribute |
| 72 | +\item ability to require constant initialization with \keyword{constinit} keyword |
| 73 | +\item ability to require constant evaluation with \keyword{consteval} keyword |
| 74 | +\item extension of constant evaluation support to cover |
| 75 | +\begin{itemize} |
| 76 | + \item memory allocation and deallocation |
| 77 | + \item virtual function calls |
| 78 | + \item \keyword{dynamic_cast} and \keyword{typeid} |
| 79 | + \item changing the active member of a union |
| 80 | + \item uninitialized variables |
| 81 | +\end{itemize} |
| 82 | +\item support for constexpr functions to contain |
| 83 | +\keyword{catch} handlers and \grammarterm{asm-declaration}s |
| 84 | +that are not reached during constant evaluation |
| 85 | +\item support for controlling destruction in a class-specific operator delete function |
| 86 | +\item addition of \keyword{using} \keyword{enum} declaration |
| 87 | +\item addition of \keyword{char8_t} type |
| 88 | +\item guarantee that \keyword{char16_t} and \keyword{char32_t} literals |
| 89 | +are encoded as UTF-16 and UTF-32 respectively |
| 90 | +\item support for an initializer statement in range-based for loops |
| 91 | +\item support for default member initializers for bit-fields |
| 92 | +\item support for parenthesized aggregate initialization |
| 93 | +\item extended support for lambda expressions, including |
| 94 | +\begin{itemize} |
| 95 | + \item explicit \grammarterm{template-head}s in generic lambdas |
| 96 | + \item default construction and assignment of stateless closure types |
| 97 | + \item lambda expressions in unevaluated operands |
| 98 | + \item pack expansion of lambda \grammarterm{init-capture}s |
| 99 | +\end{itemize} |
| 100 | +\item generalized support for structured bindings |
| 101 | +\item support for inline namespaces in nested namespace definitions |
| 102 | +\item support for conditionally-explicit member functions |
| 103 | +\item extended support for class template argument deduction to cover |
| 104 | +aggregate initialization and alias templates |
| 105 | +\item reduced cases in which \keyword{typename} is required |
| 106 | +\item support for calling an undeclared \grammarterm{template-id} |
| 107 | +via argument-dependent name lookup |
| 108 | +\item relaxed access checking rules in template specialization declarations |
| 109 | +\item revised memory model |
| 110 | +\item expanded cases in which returned or thrown variables are implicitly moved |
| 111 | +\item extended support for variadic macros with \mname{VA_OPT} |
| 112 | +% library changes |
| 113 | +\item feature test macros and \libheaderref{version} header |
| 114 | +\item restricted valid uses of standard library functions and function templates |
| 115 | +\item addition of ranges and \libheaderref{ranges} header |
| 116 | +\item addition of calendar and time zone support |
| 117 | +\item addition of text formatting library and \libheaderref{format} header |
| 118 | +\item addition of synchronization facilities for |
| 119 | +waiting, notifications, semaphores, latches, and barriers, and |
| 120 | +\libheaderref{barrier}, \libheaderref{latch} and \libheaderref{semaphore} headers |
| 121 | +\item addition of mathematical constants library and \libheaderref{numbers} header |
| 122 | +\item support for representing source locations and \libheaderrefx{source_location}{source.location.syn} header |
| 123 | +\item addition of \tcode{span} view and \libheaderref{span} header |
| 124 | +\item addition of joining thread class and \libheaderrefx{stop_token}{thread.stoptoken.syn} header |
| 125 | +\item extensions to atomic types and operations, including |
| 126 | +\begin{itemize} |
| 127 | + \item new class template \tcode{atomic_ref} |
| 128 | + \item new atomic floating-point operations |
| 129 | + \item new atomic smart pointer types |
| 130 | + \item support for compare-and-exchange operations on types with padding |
| 131 | + \item conversion of \tcode{memory_order} to a scoped enumeration |
| 132 | +\end{itemize} |
| 133 | +\item addition of \tcode{unsequenced} execution policy |
| 134 | +\item new utility functions, types, and templates in the standard library, including |
| 135 | +\begin{itemize} |
| 136 | + \item \raggedright new type traits |
| 137 | + \tcode{is_bounded_array}, |
| 138 | + \tcode{is_corresponding_member}, |
| 139 | + \tcode{is_layout_compatible}, |
| 140 | + \tcode{is_nothrow_convertible}, |
| 141 | + \tcode{is_pointer_interconvertible_base_of}, |
| 142 | + \tcode{is_pointer_interconvertible_with_class}, and |
| 143 | + \tcode{is_unbounded_array} |
| 144 | + \item new transformation traits |
| 145 | + \tcode{remove_cvref}, |
| 146 | + \tcode{type_identity}, |
| 147 | + \tcode{unwrap_ref_decay}, and |
| 148 | + \tcode{unwrap_reference} |
| 149 | + \item new standard library primitive functions \tcode{assume_aligned} and |
| 150 | + \tcode{is_constant_evaluated} |
| 151 | + \item new free functions \tcode{erase} and \tcode{erase_if} for containers |
| 152 | + \item utilities for uses-allocator construction |
| 153 | + \item function template \tcode{to_address} |
| 154 | + \item function template \tcode{bind_front} |
| 155 | + \item function template \tcode{to_array} |
| 156 | +\end{itemize} |
| 157 | +\item \tcode{make_shared} support for array types |
| 158 | +\item support for allocating objects owned by \tcode{shared_ptr} and \tcode{unique_ptr} |
| 159 | +with default initialization |
| 160 | +\item addition of bit manipulation library and \libheaderref{bit} header |
| 161 | +\item addition of a synchronized buffered output stream and \libheaderref{syncstream} header |
| 162 | +\item addition of \tcode{shift} algorithms |
| 163 | +\item addition of \tcode{midpoint} and \tcode{lerp} math functions |
| 164 | +\item use of \tcode{[[nodiscard]]} attribute in the standard library |
| 165 | +\item support for heterogeneous lookup for unordered containers |
| 166 | +\item support for element existence detection in associative containers |
| 167 | +\item change to return removed element count |
| 168 | +from \tcode{remove}, \tcode{remove_if}, and \tcode{unique} |
| 169 | +member functions on \tcode{list} and \tcode{forward_list} |
| 170 | +\item addition of \tcode{starts_with} and \tcode{ends_with} |
| 171 | +to \tcode{basic_string} and \tcode{basic_string_view} |
| 172 | +\item support for move semantics in \libheaderrefx{numeric}{numeric.ops.overview} algorithms |
| 173 | +\item support for efficient access to the buffer of a \tcode{basic_stringbuf} |
| 174 | +\item extended constant expression evaluation support in the standard library |
| 175 | +to cover more algorithms, utilities, and types, including |
| 176 | +\tcode{pair}, \tcode{tuple}, \tcode{vector}, and \tcode{string} |
| 177 | +% annexes |
| 178 | +\item removal of deprecated features |
| 179 | +\end{itemize} |
| 180 | + |
| 181 | +Any feedback or questions on this document |
| 182 | +should be directed to the user's national standards body. |
| 183 | +A complete listing of these bodies can be found at |
| 184 | +\href{http://www.iso.org/members.html}{\tcode{www.iso.org/members.html}}. |
0 commit comments