|
1085 | 1085 | and
|
1086 | 1086 | \tcode{<unordered_set>}.
|
1087 | 1087 | In addition the following C compatibility headers are new:
|
1088 |
| -\tcode{<ccomplex>}, |
1089 | 1088 | \tcode{<cfenv>},
|
1090 | 1089 | \tcode{<cinttypes>},
|
1091 |
| -\tcode{<cstdalign>}, |
1092 |
| -\tcode{<cstdbool>}, |
1093 | 1090 | \tcode{<cstdint>},
|
1094 |
| -\tcode{<ctgmath>}, |
1095 | 1091 | and
|
1096 | 1092 | \tcode{<cuchar>}.
|
1097 | 1093 | Valid \CppIII{} code that \tcode{\#include}{s} headers with these names may be
|
|
1123 | 1119 | \rSec2[diff.cpp03.language.support]{\ref{language.support}:
|
1124 | 1120 | language support library}
|
1125 | 1121 |
|
1126 |
| -\diffref{new.delete.single} |
1127 |
| -\change Linking \tcode{new} and \tcode{delete} operators. |
1128 |
| -\rationale The two throwing single-object signatures of \tcode{operator new} and |
1129 |
| -\tcode{operator delete} are now specified to form the base functionality for |
1130 |
| -the other operators. This clarifies that replacing just these two signatures |
1131 |
| -changes others, even if they are not explicitly changed. |
1132 |
| -\effect |
1133 |
| -Valid \CppIII{} code that replaces global \tcode{new} or \tcode{delete} |
1134 |
| -operators may execute differently in this International Standard. For |
1135 |
| -example, the following program should write \tcode{"custom deallocation"} twice, |
1136 |
| -once for the single-object delete and once for the array delete. |
1137 |
| - |
1138 |
| -\begin{codeblock} |
1139 |
| -#include <cstdio> |
1140 |
| -#include <cstdlib> |
1141 |
| -#include <new> |
1142 |
| - |
1143 |
| -void* operator new(std::size_t size) throw(std::bad_alloc) { |
1144 |
| - return std::malloc(size); |
1145 |
| -} |
1146 |
| - |
1147 |
| -void operator delete(void* ptr) throw() { |
1148 |
| - std::puts("custom deallocation"); |
1149 |
| - std::free(ptr); |
1150 |
| -} |
1151 |
| - |
1152 |
| -int main() { |
1153 |
| - int* i = new int; |
1154 |
| - delete i; // single-object delete |
1155 |
| - int* a = new int[3]; |
1156 |
| - delete [] a; // array delete |
1157 |
| -} |
1158 |
| -\end{codeblock} |
1159 |
| - |
1160 | 1122 | \diffref{new.delete.single}
|
1161 | 1123 | \change \tcode{operator new} may throw exceptions other than
|
1162 | 1124 | \tcode{std::bad_alloc}.
|
|
1165 | 1127 | Valid \CppIII{} code that assumes that global \tcode{operator new} only
|
1166 | 1128 | throws \tcode{std::bad_alloc} may execute differently in this International
|
1167 | 1129 | Standard.
|
| 1130 | +Valid \CppIII{} code that replaces the global replaceable \tcode{operator new} |
| 1131 | +is ill-formed in this International Standard, |
| 1132 | +because the exception specification of \tcode{throw(std::bad_alloc)} |
| 1133 | +was removed. |
1168 | 1134 |
|
1169 | 1135 | \rSec2[diff.cpp03.diagnostics]{\ref{diagnostics}: diagnostics library}
|
1170 | 1136 |
|
|
1186 | 1152 | have different runtime behavior.
|
1187 | 1153 |
|
1188 | 1154 | \diffref{refwrap}, \ref{arithmetic.operations}, \ref{comparisons},
|
1189 |
| -\ref{logical.operations}, \ref{bitwise.operations}, \ref{depr.negators} |
| 1155 | +\ref{logical.operations}, \ref{bitwise.operations} |
1190 | 1156 | \change Standard function object types no longer derived from
|
1191 | 1157 | \tcode{std::unary_function} or \tcode{std::binary_function}.
|
1192 | 1158 | \rationale Superseded by new feature; \tcode{unary_function} and
|
|
1800 | 1766 |
|
1801 | 1767 | \rSec2[diff.cpp14.depr]{\ref{depr}: compatibility features}
|
1802 | 1768 |
|
| 1769 | +\nodiffref |
1803 | 1770 | \change
|
1804 | 1771 | The class templates
|
1805 | 1772 | \tcode{auto_ptr},
|
|
1818 | 1785 | \effect Valid \CppXIV{} code that uses these class templates
|
1819 | 1786 | and function templates may fail to compile in this International Standard.
|
1820 | 1787 |
|
| 1788 | +\nodiffref |
1821 | 1789 | \change
|
1822 | 1790 | Remove old iostreams members [depr.ios.members].
|
1823 | 1791 | \rationale Redundant feature for compatibility with pre-standard code
|
|
1987 | 1955 | }
|
1988 | 1956 | \end{codeblock}
|
1989 | 1957 |
|
| 1958 | +\rSec2[diff.cpp17.except]{\ref{except}: exception handling} |
| 1959 | + |
| 1960 | +\diffref{except.spec} |
| 1961 | +\change Remove \tcode{throw()} exception specification. |
| 1962 | +\rationale |
| 1963 | +Removal of obsolete feature that has been replaced by \tcode{noexcept}. |
| 1964 | +\effect |
| 1965 | +A valid \CppXVII{} function declaration, member function declaration, function |
| 1966 | +pointer declaration, or function reference declaration that uses \tcode{throw()} |
| 1967 | +for its exception specification will be rejected as ill-formed in this |
| 1968 | +International Standard. It should simply be replaced with \tcode{noexcept} for no |
| 1969 | +change of meaning since \CppXVII{}. |
| 1970 | +\begin{note} |
| 1971 | +There is no way to write a function declaration |
| 1972 | +that is non-throwing in this International Standard |
| 1973 | +and is also non-throwing in \CppIII{} |
| 1974 | +except by using the preprocessor to generate |
| 1975 | +a different token sequence in each case. |
| 1976 | +\end{note} |
| 1977 | + |
1990 | 1978 | \rSec2[diff.cpp17.library]{\ref{library}: library introduction}
|
1991 | 1979 |
|
1992 | 1980 | \diffref{headers}
|
1993 | 1981 | \change New headers.
|
1994 | 1982 | \rationale New functionality.
|
1995 | 1983 | \effect
|
1996 | 1984 | The following \Cpp{} headers are new:
|
| 1985 | +\tcode{<bit>}, |
1997 | 1986 | \tcode{<compare>},
|
| 1987 | +\tcode{<concepts>}, |
| 1988 | +\tcode{<contract>}, |
1998 | 1989 | \tcode{<span>},
|
1999 | 1990 | \tcode{<syncstream>}, and
|
2000 | 1991 | \tcode{<version>}.
|
2001 | 1992 | Valid \CppXVII{} code that \tcode{\#include}{s} headers with these names may be
|
2002 | 1993 | invalid in this International Standard.
|
2003 | 1994 |
|
| 1995 | +\diffref{headers} |
| 1996 | +\change Remove vacuous \Cpp{} header files. |
| 1997 | +\rationale |
| 1998 | +The empty headers implied a false requirement to achieve C compatibility with the \Cpp{} headers. |
| 1999 | +\effect |
| 2000 | +A valid \CppXVII{} program that \tcode{\#include}{s} any of the following headers may fail to compile: |
| 2001 | +\tcode{<ccomplex>}, |
| 2002 | +\tcode{<ciso646>}, |
| 2003 | +\tcode{<cstdalign>}, |
| 2004 | +\tcode{<cstdbool>}, and |
| 2005 | +\tcode{<ctgmath>}. |
| 2006 | +To retain the same behavior: |
| 2007 | +\begin{itemize} |
| 2008 | +\item |
| 2009 | +a \tcode{\#include} of \tcode{<ccomplex>} can be replaced by |
| 2010 | +a \tcode{\#include} of \tcode{<complex>}\iref{complex.syn}, |
| 2011 | +\item |
| 2012 | +a \tcode{\#include} of \tcode{<ctgmath>} can be replaced by |
| 2013 | +a \tcode{\#include} of \tcode{<cmath>}\iref{cmath.syn} and |
| 2014 | +a \tcode{\#include} of \tcode{<complex>}, |
| 2015 | +and |
| 2016 | +\item |
| 2017 | +a \tcode{\#include} of |
| 2018 | +\tcode{<ciso646>}, |
| 2019 | +\tcode{<cstdalign>}, or |
| 2020 | +\tcode{<cstdbool>} |
| 2021 | +can simply be removed. |
| 2022 | +\end{itemize} |
| 2023 | + |
2004 | 2024 | \rSec2[diff.cpp17.containers]{\ref{containers}: containers library}
|
2005 | 2025 |
|
2006 | 2026 | \diffrefs{forwardlist}{list}
|
|
2013 | 2033 | Translation units compiled against this version of \Cpp{} may be incompatible with
|
2014 | 2034 | translation units compiled against \CppXVII{}, either failing to link or having undefined behavior.
|
2015 | 2035 |
|
| 2036 | +\rSec2[diff.cpp17.depr]{\ref{depr}: compatibility features} |
| 2037 | + |
| 2038 | +\nodiffref |
| 2039 | +\change Remove \tcode{uncaught_exception}. |
| 2040 | +\rationale |
| 2041 | +The function did not have a clear specification when multiple exceptions were |
| 2042 | +active, and has been superseded by \tcode{uncaught_exceptions}. |
| 2043 | +\effect |
| 2044 | +A valid \CppXVII{} program that calls \tcode{std::uncaught_exception} may fail |
| 2045 | +to compile. It might be revised to use \tcode{std::uncaught_exceptions} instead, |
| 2046 | +for clear and portable semantics. |
| 2047 | + |
| 2048 | +\nodiffref |
| 2049 | +\change Remove support for adaptable function API. |
| 2050 | +\rationale |
| 2051 | +The deprecated support relied on a limited convention that could not be |
| 2052 | +extended to support the general case or new language features. It has been |
| 2053 | +superseded by direct language support with \tcode{decltype}, and by the |
| 2054 | +\tcode{std::bind} and \tcode{std::not_fn} function templates. |
| 2055 | +\effect |
| 2056 | +A valid \CppXVII{} program that relies on the presence of \tcode{result_type}, |
| 2057 | +\tcode{argument_type}, \tcode{first_argument_type}, or |
| 2058 | +\tcode{second_argument_type} in a standard library class may fail to compile. A |
| 2059 | +valid \CppXVII{} program that calls \tcode{not1} or \tcode{not2}, or uses the |
| 2060 | +class templates \tcode{unary_negate} or \tcode{binary_negate}, may fail to |
| 2061 | +compile. |
| 2062 | + |
| 2063 | +\nodiffref |
| 2064 | +\change Remove redundant members from \tcode{std::allocator}. |
| 2065 | +\rationale |
| 2066 | +\tcode{std::allocator} was overspecified, encouraging direct usage in user containers |
| 2067 | +rather than relying on \tcode{std::allocator_traits}, leading to poor containers. |
| 2068 | +\effect |
| 2069 | +A valid \CppXVII{} program that directly makes use of the \tcode{pointer}, |
| 2070 | +\tcode{const_pointer}, \tcode{reference}, \tcode{const_reference}, |
| 2071 | +\tcode{rebind}, \tcode{address}, \tcode{construct}, \tcode{destroy}, or |
| 2072 | +\tcode{max_size} members of \tcode{std::allocator}, or that directly calls |
| 2073 | +\tcode{allocate} with an additional hint argument, may fail to compile. |
| 2074 | + |
| 2075 | +\nodiffref |
| 2076 | +\change Remove \tcode{raw_memory_iterator}. |
| 2077 | +\rationale |
| 2078 | +The iterator encouraged use of algorithms that might throw exceptions, but did |
| 2079 | +not return the number of elements successfully constructed that might need to |
| 2080 | +be destroyed in order to avoid leaks. |
| 2081 | +\effect |
| 2082 | +A valid \CppXVII{} program that uses this iterator class may fail to compile. |
| 2083 | + |
| 2084 | +\nodiffref |
| 2085 | +\change Remove temporary buffers API. |
| 2086 | +\rationale |
| 2087 | +The temporary buffer facility was intended to provide an efficient optimization |
| 2088 | +for small memory requests, but there is little evidence this was achieved in |
| 2089 | +practice, while requiring the user to provide their own exception-safe wrappers |
| 2090 | +to guard use of the facility in many cases. |
| 2091 | +\effect |
| 2092 | +A valid \CppXVII{} program that calls \tcode{get_temporary_buffer} or |
| 2093 | +\tcode{return_temporary_buffer} may fail to compile. |
| 2094 | + |
| 2095 | +\nodiffref |
| 2096 | +\change Remove \tcode{shared_ptr::unique}. |
| 2097 | +\rationale |
| 2098 | +The result of a call to this member function is not reliable in the presence of |
| 2099 | +multiple threads and weak pointers. The member function \tcode{use_count} is |
| 2100 | +similarly unreliable, but has a clearer contract in such cases, and remains |
| 2101 | +available for well defined use in single-threaded cases. |
| 2102 | +\effect |
| 2103 | +A valid \CppXVII{} program that calls \tcode{unique} on a \tcode{shared_ptr} |
| 2104 | +object may fail to compile. |
| 2105 | + |
| 2106 | +\diffref{depr.meta.types} |
| 2107 | +\change Remove deprecated type traits. |
| 2108 | +\rationale |
| 2109 | +The traits had unreliable or awkward interfaces. The \tcode{is_literal_type} |
| 2110 | +trait provided no way to detect which subset of constructors and member |
| 2111 | +functions of a type were declared \tcode{constexpr}. The \tcode{result_of} |
| 2112 | +trait had a surprising syntax that could not report the result of a regular |
| 2113 | +function type. It has been superseded by the \tcode{invoke_result} trait. |
| 2114 | +\effect |
| 2115 | +A valid \CppXVII{} program that relies on the \tcode{is_literal_type} or |
| 2116 | +\tcode{result_of} type traits, on the \tcode{is_literal_type_v} variable template, |
| 2117 | +or on the \tcode{result_of_t} alias template may fail to compile. |
| 2118 | + |
2016 | 2119 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
2017 | 2120 | \rSec1[diff.library]{C standard library}
|
2018 | 2121 | \indextext{library!C standard}%
|
|
2031 | 2134 | in~\ref{depr.c.headers}, but their use is deprecated in \Cpp{}.
|
2032 | 2135 |
|
2033 | 2136 | \pnum
|
2034 |
| -There are no \Cpp{} headers for the C headers |
| 2137 | +There are no \Cpp{} headers for the C standard library's headers |
2035 | 2138 | \tcode{<stdatomic.h>}\indextext{\idxhdr{stdatomic.h}!absence thereof},
|
2036 | 2139 | \tcode{<stdnoreturn.h>}\indextext{\idxhdr{stdnoreturn.h}!absence thereof},
|
2037 | 2140 | and \tcode{<threads.h>}\indextext{\idxhdr{threads.h}!absence thereof},
|
2038 |
| -nor are the C headers themselves part of \Cpp{}. |
| 2141 | +nor are these headers from the C standard library headers themselves part of \Cpp{}. |
2039 | 2142 |
|
2040 | 2143 | \pnum
|
2041 |
| -The \Cpp{} headers \tcode{<ccomplex>}\indexhdr{ccomplex}\iref{depr.ccomplex.syn} |
2042 |
| -and \tcode{<ctgmath>}\indexhdr{ctgmath}\iref{depr.ctgmath.syn}, as well |
2043 |
| -as their corresponding C headers \tcode{<complex.h>}\indexhdr{complex.h} |
2044 |
| -and \tcode{<tgmath.h>}\indexhdr{tgmath.h}, do not contain any of the |
2045 |
| -content from the C standard library and instead merely include other headers |
2046 |
| -from the \Cpp{} standard library. |
2047 |
| - |
2048 |
| -\pnum |
2049 |
| -The headers \tcode{<ciso646>}\indexhdr{ciso646}, |
2050 |
| -\tcode{<cstdalign>}\indexhdr{cstdalign}\iref{depr.cstdalign.syn}, |
2051 |
| -and \tcode{<cstdbool>}\indexhdr{cstdbool}\iref{depr.cstdbool.syn} |
2052 |
| -are meaningless in \Cpp{}. Use of |
2053 |
| -the \Cpp{} headers \tcode{<ccomplex>}, \tcode{<cstdalign>}, \tcode{<cstdbool>}, |
2054 |
| -and \tcode{<ctgmath>} is deprecated\iref{depr.c.headers}. |
| 2144 | +The C headers \tcode{<complex.h>}\indexhdr{complex.h} and |
| 2145 | +\tcode{<tgmath.h>}\indexhdr{tgmath.h} do not contain any of the content from |
| 2146 | +the C standard library and instead merely include other headers from the \Cpp{} |
| 2147 | +standard library. |
2055 | 2148 |
|
2056 | 2149 | \rSec2[diff.mods.to.definitions]{Modifications to definitions}
|
2057 | 2150 |
|
|
2103 | 2196 | and
|
2104 | 2197 | \tcode{xor_eq}
|
2105 | 2198 | are keywords in this International
|
2106 |
| -Standard\iref{lex.key}. |
2107 |
| -They do not appear as macro names defined in |
2108 |
| -\tcode{<ciso646>}. |
2109 |
| -\indexhdr{ciso646}% |
| 2199 | +Standard\iref{lex.key}, |
| 2200 | +and are not introduced as macros |
| 2201 | +by \tcode{<iso646.h>}\iref{depr.iso646.h.syn}. |
2110 | 2202 |
|
2111 | 2203 | \rSec3[diff.header.stdalign.h]{Header \tcode{<stdalign.h>}}
|
2112 | 2204 | \indexhdr{stdalign.h}%
|
2113 | 2205 |
|
2114 | 2206 | \pnum
|
2115 | 2207 | The token \tcode{alignas} is a keyword in this International
|
2116 |
| -Standard\iref{lex.key}. It does not appear as a macro name defined |
2117 |
| -in \tcode{<cstdalign>}\indexhdr{cstdalign}\iref{depr.cstdalign.syn}. |
| 2208 | +Standard\iref{lex.key}, |
| 2209 | +and is not introduced as a macro |
| 2210 | +by \tcode{<stdalign.h>}\iref{depr.stdalign.h.syn}. |
2118 | 2211 |
|
2119 | 2212 | \rSec3[diff.header.stdbool.h]{Header \tcode{<stdbool.h>}}
|
2120 | 2213 | \indexhdr{stdbool.h}%
|
2121 | 2214 |
|
2122 | 2215 | \pnum
|
2123 | 2216 | The tokens \tcode{bool}, \tcode{true}, and \tcode{false}
|
2124 |
| -are keywords in this International Standard\iref{lex.key}. |
2125 |
| -They do not appear as macro names defined in |
2126 |
| -\tcode{<cstdbool>}\indexhdr{cstdbool}\iref{depr.cstdbool.syn}. |
| 2217 | +are keywords in this International Standard\iref{lex.key}, |
| 2218 | +and are not introduced as macros |
| 2219 | +by \tcode{<stdbool.h>}\iref{depr.stdbool.h.syn}. |
2127 | 2220 |
|
2128 | 2221 | \rSec3[diff.null]{Macro \tcode{NULL}}
|
2129 | 2222 |
|
|
0 commit comments