Skip to content

Commit 7f7170c

Browse files
AlisdairMtkoeppe
authored andcommitted
[depr] Reorder clauses by origin of deprecation
Reorders the deprecated features annex to follow the order of the main clauses that the deprecates feature refers to. Where multiple clauses are references, use the one named by the [depr.XXX] stable label.
1 parent 7ad39cb commit 7f7170c

File tree

1 file changed

+155
-155
lines changed

1 file changed

+155
-155
lines changed

source/future.tex

Lines changed: 155 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,26 @@
1616
An implementation may declare library names and entities described in this Clause with the
1717
\tcode{deprecated} attribute\iref{dcl.attr.deprecated}.
1818

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+
1939
\rSec1[depr.capture.this]{Implicit capture of \tcode{*this} by reference}
2040

2141
\pnum
@@ -35,25 +55,6 @@
3555
\end{codeblock}
3656
\end{example}
3757

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-
5758
\rSec1[depr.volatile.type]{Deprecated \tcode{volatile} types}
5859

5960
\pnum
@@ -115,40 +116,22 @@
115116
\end{example}
116117

117118

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}
136120

137121
\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.
140125
\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.
142127
\end{note}
143128
\begin{example}
144129
\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
152135
\end{codeblock}
153136
\end{example}
154137

@@ -166,6 +149,23 @@
166149
It is possible that future versions of \Cpp{} will specify
167150
that these implicit definitions are deleted\iref{dcl.fct.def.delete}.
168151

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+
169169
\rSec1[depr.lit]{Literal operator function declarations using an identifier}
170170

171171
\pnum
@@ -244,86 +244,6 @@
244244
#define @\xname{bool_true_false_are_defined}@ 1
245245
\end{codeblock}
246246

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-
327247
\rSec1[depr.cerrno]{Deprecated error numbers}
328248

329249
\pnum
@@ -483,6 +403,86 @@
483403
whose value is the strictest alignment of all types listed in \tcode{Types}.
484404
\end{itemdescr}
485405

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+
486486
\rSec1[depr.tuple]{Tuple}
487487

488488
\pnum
@@ -674,34 +674,6 @@
674674
\tcode{current}.
675675
\end{itemdescr}
676676

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-
705677
\rSec1[depr.locale.category]{Deprecated locale category facets}
706678

707679
\pnum
@@ -741,6 +713,34 @@
741713
\tcode{codecvt<char32_t, char8_t, mbstate_t>}
742714
convert between the UTF-32 and UTF-8 encoding forms.
743715

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+
744744
\rSec1[depr.fs.path.factory]{Deprecated filesystem path factory functions}
745745

746746
\pnum

0 commit comments

Comments
 (0)