|
16 | 16 | An implementation may declare library names and entities described in this Clause with the
|
17 | 17 | \tcode{deprecated} attribute\iref{dcl.attr.deprecated}.
|
18 | 18 |
|
| 19 | +\rSec1[depr.local]{Non-local use of TU-local entities} |
| 20 | + |
| 21 | +\pnum |
| 22 | +A declaration of a non-TU-local entity that is an exposure\iref{basic.link} |
| 23 | +is deprecated. |
| 24 | +\begin{note} |
| 25 | +Such a declaration in an importable module unit is ill-formed. |
| 26 | +\end{note} |
| 27 | +\begin{example} |
| 28 | +\begin{codeblock} |
| 29 | +namespace { |
| 30 | + struct A { |
| 31 | + void f() {} |
| 32 | + }; |
| 33 | +} |
| 34 | +A h(); // deprecated: not internal linkage |
| 35 | +inline void g() {A().f();} // deprecated: inline and not internal linkage |
| 36 | +\end{codeblock} |
| 37 | +\end{example} |
| 38 | + |
19 | 39 | \rSec1[depr.capture.this]{Implicit capture of \tcode{*this} by reference}
|
20 | 40 |
|
21 | 41 | \pnum
|
|
35 | 55 | \end{codeblock}
|
36 | 56 | \end{example}
|
37 | 57 |
|
38 |
| -\rSec1[depr.array.comp]{Array comparisons} |
39 |
| - |
40 |
| -\pnum |
41 |
| -Equality and relational comparisons\iref{expr.eq,expr.rel} |
42 |
| -between two operands of array type |
43 |
| -are deprecated. |
44 |
| -\begin{note} |
45 |
| -Three-way comparisons\iref{expr.spaceship} between such operands are ill-formed. |
46 |
| -\end{note} |
47 |
| -\begin{example} |
48 |
| -\begin{codeblock} |
49 |
| -int arr1[5]; |
50 |
| -int arr2[5]; |
51 |
| -bool same = arr1 == arr2; // deprecated, same as \tcode{\&arr1[0] == \&arr2[0]}, |
52 |
| - // does not compare array contents |
53 |
| -auto cmp = arr1 <=> arr2; // error |
54 |
| -\end{codeblock} |
55 |
| -\end{example} |
56 |
| - |
57 | 58 | \rSec1[depr.volatile.type]{Deprecated \tcode{volatile} types}
|
58 | 59 |
|
59 | 60 | \pnum
|
|
115 | 116 | \end{example}
|
116 | 117 |
|
117 | 118 |
|
118 |
| -\rSec1[depr.static.constexpr]{Redeclaration of \tcode{static constexpr} data members} |
119 |
| - |
120 |
| -\pnum |
121 |
| -For compatibility with prior revisions of \Cpp{}, a \keyword{constexpr} |
122 |
| -static data member may be redundantly redeclared outside the class with no |
123 |
| -initializer\iref{basic.def,class.static.data}. |
124 |
| -This usage is deprecated. |
125 |
| -\begin{example} |
126 |
| -\begin{codeblock} |
127 |
| -struct A { |
128 |
| - static constexpr int n = 5; // definition (declaration in \CppXIV{}) |
129 |
| -}; |
130 |
| - |
131 |
| -constexpr int A::n; // redundant declaration (definition in \CppXIV{}) |
132 |
| -\end{codeblock} |
133 |
| -\end{example} |
134 |
| - |
135 |
| -\rSec1[depr.local]{Non-local use of TU-local entities} |
| 119 | +\rSec1[depr.array.comp]{Array comparisons} |
136 | 120 |
|
137 | 121 | \pnum
|
138 |
| -A declaration of a non-TU-local entity that is an exposure\iref{basic.link} |
139 |
| -is deprecated. |
| 122 | +Equality and relational comparisons\iref{expr.eq,expr.rel} |
| 123 | +between two operands of array type |
| 124 | +are deprecated. |
140 | 125 | \begin{note}
|
141 |
| -Such a declaration in an importable module unit is ill-formed. |
| 126 | +Three-way comparisons\iref{expr.spaceship} between such operands are ill-formed. |
142 | 127 | \end{note}
|
143 | 128 | \begin{example}
|
144 | 129 | \begin{codeblock}
|
145 |
| -namespace { |
146 |
| - struct A { |
147 |
| - void f() {} |
148 |
| - }; |
149 |
| -} |
150 |
| -A h(); // deprecated: not internal linkage |
151 |
| -inline void g() {A().f();} // deprecated: inline and not internal linkage |
| 130 | +int arr1[5]; |
| 131 | +int arr2[5]; |
| 132 | +bool same = arr1 == arr2; // deprecated, same as \tcode{\&arr1[0] == \&arr2[0]}, |
| 133 | + // does not compare array contents |
| 134 | +auto cmp = arr1 <=> arr2; // error |
152 | 135 | \end{codeblock}
|
153 | 136 | \end{example}
|
154 | 137 |
|
|
166 | 149 | It is possible that future versions of \Cpp{} will specify
|
167 | 150 | that these implicit definitions are deleted\iref{dcl.fct.def.delete}.
|
168 | 151 |
|
| 152 | +\rSec1[depr.static.constexpr]{Redeclaration of \tcode{static constexpr} data members} |
| 153 | + |
| 154 | +\pnum |
| 155 | +For compatibility with prior revisions of \Cpp{}, a \keyword{constexpr} |
| 156 | +static data member may be redundantly redeclared outside the class with no |
| 157 | +initializer\iref{basic.def,class.static.data}. |
| 158 | +This usage is deprecated. |
| 159 | +\begin{example} |
| 160 | +\begin{codeblock} |
| 161 | +struct A { |
| 162 | + static constexpr int n = 5; // definition (declaration in \CppXIV{}) |
| 163 | +}; |
| 164 | + |
| 165 | +constexpr int A::n; // redundant declaration (definition in \CppXIV{}) |
| 166 | +\end{codeblock} |
| 167 | +\end{example} |
| 168 | + |
169 | 169 | \rSec1[depr.lit]{Literal operator function declarations using an identifier}
|
170 | 170 |
|
171 | 171 | \pnum
|
|
244 | 244 | #define @\xname{bool_true_false_are_defined}@ 1
|
245 | 245 | \end{codeblock}
|
246 | 246 |
|
247 |
| -\rSec1[depr.relops]{Relational operators}% |
248 |
| -\indexlibraryglobal{rel_ops}% |
249 |
| - |
250 |
| -\pnum |
251 |
| -The header \libheaderref{utility} has the following additions: |
252 |
| - |
253 |
| -\begin{codeblock} |
254 |
| -namespace std::rel_ops { |
255 |
| - template<class T> bool operator!=(const T&, const T&); |
256 |
| - template<class T> bool operator> (const T&, const T&); |
257 |
| - template<class T> bool operator<=(const T&, const T&); |
258 |
| - template<class T> bool operator>=(const T&, const T&); |
259 |
| -} |
260 |
| -\end{codeblock} |
261 |
| - |
262 |
| -\pnum |
263 |
| -To avoid redundant definitions of \tcode{operator!=} out of \tcode{operator==} |
264 |
| -and operators \tcode{>}, \tcode{<=}, and \tcode{>=} out of \tcode{operator<}, |
265 |
| -the library provides the following: |
266 |
| - |
267 |
| -\indexlibrary{\idxcode{operator"!=}}% |
268 |
| -\begin{itemdecl} |
269 |
| -template<class T> bool operator!=(const T& x, const T& y); |
270 |
| -\end{itemdecl} |
271 |
| - |
272 |
| -\begin{itemdescr} |
273 |
| -\pnum |
274 |
| -\expects |
275 |
| -\tcode{T} meets the \oldconcept{EqualityComparable} requirements (\tref{cpp17.equalitycomparable}). |
276 |
| - |
277 |
| -\pnum |
278 |
| -\returns |
279 |
| -\tcode{!(x == y)}. |
280 |
| -\end{itemdescr} |
281 |
| - |
282 |
| -\indexlibraryglobal{operator>}% |
283 |
| -\begin{itemdecl} |
284 |
| -template<class T> bool operator>(const T& x, const T& y); |
285 |
| -\end{itemdecl} |
286 |
| - |
287 |
| -\begin{itemdescr} |
288 |
| -\pnum |
289 |
| -\expects |
290 |
| -\tcode{T} meets the \oldconcept{LessThanComparable} requirements (\tref{cpp17.lessthancomparable}). |
291 |
| - |
292 |
| -\pnum |
293 |
| -\returns |
294 |
| -\tcode{y < x}. |
295 |
| -\end{itemdescr} |
296 |
| - |
297 |
| -\indexlibrary{\idxcode{operator<=}}% |
298 |
| -\begin{itemdecl} |
299 |
| -template<class T> bool operator<=(const T& x, const T& y); |
300 |
| -\end{itemdecl} |
301 |
| - |
302 |
| -\begin{itemdescr} |
303 |
| -\pnum |
304 |
| -\expects |
305 |
| -\tcode{T} meets the \oldconcept{LessThanComparable} requirements (\tref{cpp17.lessthancomparable}). |
306 |
| - |
307 |
| -\pnum |
308 |
| -\returns |
309 |
| -\tcode{!(y < x)}. |
310 |
| -\end{itemdescr} |
311 |
| - |
312 |
| -\indexlibrary{\idxcode{operator>=}}% |
313 |
| -\begin{itemdecl} |
314 |
| -template<class T> bool operator>=(const T& x, const T& y); |
315 |
| -\end{itemdecl} |
316 |
| - |
317 |
| -\begin{itemdescr} |
318 |
| -\pnum |
319 |
| -\expects |
320 |
| -\tcode{T} meets the \oldconcept{LessThanComparable} requirements (\tref{cpp17.lessthancomparable}). |
321 |
| - |
322 |
| -\pnum |
323 |
| -\returns |
324 |
| -\tcode{!(x < y)}. |
325 |
| -\end{itemdescr} |
326 |
| - |
327 | 247 | \rSec1[depr.cerrno]{Deprecated error numbers}
|
328 | 248 |
|
329 | 249 | \pnum
|
|
483 | 403 | whose value is the strictest alignment of all types listed in \tcode{Types}.
|
484 | 404 | \end{itemdescr}
|
485 | 405 |
|
| 406 | +\rSec1[depr.relops]{Relational operators}% |
| 407 | +\indexlibraryglobal{rel_ops}% |
| 408 | + |
| 409 | +\pnum |
| 410 | +The header \libheaderref{utility} has the following additions: |
| 411 | + |
| 412 | +\begin{codeblock} |
| 413 | +namespace std::rel_ops { |
| 414 | + template<class T> bool operator!=(const T&, const T&); |
| 415 | + template<class T> bool operator> (const T&, const T&); |
| 416 | + template<class T> bool operator<=(const T&, const T&); |
| 417 | + template<class T> bool operator>=(const T&, const T&); |
| 418 | +} |
| 419 | +\end{codeblock} |
| 420 | + |
| 421 | +\pnum |
| 422 | +To avoid redundant definitions of \tcode{operator!=} out of \tcode{operator==} |
| 423 | +and operators \tcode{>}, \tcode{<=}, and \tcode{>=} out of \tcode{operator<}, |
| 424 | +the library provides the following: |
| 425 | + |
| 426 | +\indexlibrary{\idxcode{operator"!=}}% |
| 427 | +\begin{itemdecl} |
| 428 | +template<class T> bool operator!=(const T& x, const T& y); |
| 429 | +\end{itemdecl} |
| 430 | + |
| 431 | +\begin{itemdescr} |
| 432 | +\pnum |
| 433 | +\expects |
| 434 | +\tcode{T} meets the \oldconcept{EqualityComparable} requirements (\tref{cpp17.equalitycomparable}). |
| 435 | + |
| 436 | +\pnum |
| 437 | +\returns |
| 438 | +\tcode{!(x == y)}. |
| 439 | +\end{itemdescr} |
| 440 | + |
| 441 | +\indexlibraryglobal{operator>}% |
| 442 | +\begin{itemdecl} |
| 443 | +template<class T> bool operator>(const T& x, const T& y); |
| 444 | +\end{itemdecl} |
| 445 | + |
| 446 | +\begin{itemdescr} |
| 447 | +\pnum |
| 448 | +\expects |
| 449 | +\tcode{T} meets the \oldconcept{LessThanComparable} requirements (\tref{cpp17.lessthancomparable}). |
| 450 | + |
| 451 | +\pnum |
| 452 | +\returns |
| 453 | +\tcode{y < x}. |
| 454 | +\end{itemdescr} |
| 455 | + |
| 456 | +\indexlibrary{\idxcode{operator<=}}% |
| 457 | +\begin{itemdecl} |
| 458 | +template<class T> bool operator<=(const T& x, const T& y); |
| 459 | +\end{itemdecl} |
| 460 | + |
| 461 | +\begin{itemdescr} |
| 462 | +\pnum |
| 463 | +\expects |
| 464 | +\tcode{T} meets the \oldconcept{LessThanComparable} requirements (\tref{cpp17.lessthancomparable}). |
| 465 | + |
| 466 | +\pnum |
| 467 | +\returns |
| 468 | +\tcode{!(y < x)}. |
| 469 | +\end{itemdescr} |
| 470 | + |
| 471 | +\indexlibrary{\idxcode{operator>=}}% |
| 472 | +\begin{itemdecl} |
| 473 | +template<class T> bool operator>=(const T& x, const T& y); |
| 474 | +\end{itemdecl} |
| 475 | + |
| 476 | +\begin{itemdescr} |
| 477 | +\pnum |
| 478 | +\expects |
| 479 | +\tcode{T} meets the \oldconcept{LessThanComparable} requirements (\tref{cpp17.lessthancomparable}). |
| 480 | + |
| 481 | +\pnum |
| 482 | +\returns |
| 483 | +\tcode{!(x < y)}. |
| 484 | +\end{itemdescr} |
| 485 | + |
486 | 486 | \rSec1[depr.tuple]{Tuple}
|
487 | 487 |
|
488 | 488 | \pnum
|
|
674 | 674 | \tcode{current}.
|
675 | 675 | \end{itemdescr}
|
676 | 676 |
|
677 |
| -\rSec1[depr.format]{Deprecated formatting} |
678 |
| - |
679 |
| -\rSec2[depr.format.syn]{Header \tcode{<format>} synopsis} |
680 |
| - |
681 |
| -\pnum |
682 |
| -The header \libheaderref{format} has the following additions: |
683 |
| - |
684 |
| -\begin{codeblock} |
685 |
| -namespace std { |
686 |
| - template<class Visitor, class Context> |
687 |
| - decltype(auto) visit_format_arg(Visitor&& vis, basic_format_arg<Context> arg); |
688 |
| -} |
689 |
| -\end{codeblock} |
690 |
| - |
691 |
| -\rSec2[depr.format.arg]{Formatting arguments} |
692 |
| - |
693 |
| -\indexlibraryglobal{visit_format_arg}% |
694 |
| -\begin{itemdecl} |
695 |
| -template<class Visitor, class Context> |
696 |
| - decltype(auto) visit_format_arg(Visitor&& vis, basic_format_arg<Context> arg); |
697 |
| -\end{itemdecl} |
698 |
| - |
699 |
| -\begin{itemdescr} |
700 |
| -\pnum |
701 |
| -\effects |
702 |
| -Equivalent to: \tcode{return visit(std::forward<Visitor>(vis), arg.value);} |
703 |
| -\end{itemdescr} |
704 |
| - |
705 | 677 | \rSec1[depr.locale.category]{Deprecated locale category facets}
|
706 | 678 |
|
707 | 679 | \pnum
|
|
741 | 713 | \tcode{codecvt<char32_t, char8_t, mbstate_t>}
|
742 | 714 | convert between the UTF-32 and UTF-8 encoding forms.
|
743 | 715 |
|
| 716 | +\rSec1[depr.format]{Deprecated formatting} |
| 717 | + |
| 718 | +\rSec2[depr.format.syn]{Header \tcode{<format>} synopsis} |
| 719 | + |
| 720 | +\pnum |
| 721 | +The header \libheaderref{format} has the following additions: |
| 722 | + |
| 723 | +\begin{codeblock} |
| 724 | +namespace std { |
| 725 | + template<class Visitor, class Context> |
| 726 | + decltype(auto) visit_format_arg(Visitor&& vis, basic_format_arg<Context> arg); |
| 727 | +} |
| 728 | +\end{codeblock} |
| 729 | + |
| 730 | +\rSec2[depr.format.arg]{Formatting arguments} |
| 731 | + |
| 732 | +\indexlibraryglobal{visit_format_arg}% |
| 733 | +\begin{itemdecl} |
| 734 | +template<class Visitor, class Context> |
| 735 | + decltype(auto) visit_format_arg(Visitor&& vis, basic_format_arg<Context> arg); |
| 736 | +\end{itemdecl} |
| 737 | + |
| 738 | +\begin{itemdescr} |
| 739 | +\pnum |
| 740 | +\effects |
| 741 | +Equivalent to: \tcode{return visit(std::forward<Visitor>(vis), arg.value);} |
| 742 | +\end{itemdescr} |
| 743 | + |
744 | 744 | \rSec1[depr.fs.path.factory]{Deprecated filesystem path factory functions}
|
745 | 745 |
|
746 | 746 | \pnum
|
|
0 commit comments