You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Take view:
(2.2)— Otherwise, if T is a specialization of optional and T models view, then (static_cast<D>(F) == D() ? ((void)E, T()) : decay-copy(E)).
Drop view:
(2.2)— Otherwise, if T is a specialization of optional and T models view, then (static_cast<D>(F) == D() ? decay-copy(E) : ((void)E, T())).
Const view:
(2.3)— Otherwise, if U denotes optional<X&> for some type X, then optional<const X&>(E).
Reverse view:
(2.2)— Otherwise, if E is specialization of optional and E models view, then decay-copy(E).
Copy file name to clipboardExpand all lines: papers/P2988/optional_range_optimization.tex
+9-10Lines changed: 9 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -54,19 +54,20 @@ \chapter{Design}
54
54
55
55
\section{views::as_const}
56
56
57
-
return optional or optional<const U\&> (if T is U\&)
57
+
Return \tcode{optional}.
58
58
59
+
In contrast to \tcode{optional<const T\&>}, \tcode{optional<const T>} is not a view, because it is not assignable. In consequence it should not be returned from \tcode{views::as_const} for \tcode{optional<T>}.
59
60
\section{views::take(opt, n)}
60
61
61
-
empty optional if n is equal to zero, opt otherwise
62
+
Empty \tcode{optional} if \tcode{n} is equal to zero, \tcode{optional} otherwise.
62
63
63
64
\section{views::drop(opt, n)}
64
65
65
-
empty optional if n greater than zero, opt otherwise
66
+
Empty \tcode{optional} if \tcode{n} greater than zero, \tcode{optional} otherwise.
66
67
67
68
\section{views::reverse}
68
69
69
-
input unchanged
70
+
Input is returned unchanged.
70
71
71
72
\chapter{Wording}
72
73
The proposed changes are relative to the current working draft \cite{N5014}.
@@ -106,7 +107,7 @@ \chapter{Wording}
106
107
are indeterminately sequenced.
107
108
\begin{addedblock}
108
109
\item
109
-
Otherwise, if \tcode{T} is specialization of \tcode{optional}, then \tcode{(static_cast<D>(F) == D() ? ((void)E, T()) : \placeholdernc{decay-copy}(E))}.
110
+
Otherwise, if \tcode{T} is a specialization of \tcode{optional} and \tcode{T} models \tcode{view}, then \tcode{(static_cast<D>(F) == D() ? ((void)E, T()) : \placeholdernc{decay-copy}(E))}.
110
111
\end{addedblock}
111
112
\item
112
113
Otherwise, if \tcode{T} models
@@ -189,7 +190,7 @@ \chapter{Wording}
189
190
are indeterminately sequenced.
190
191
\begin{addedblock}
191
192
\item
192
-
Otherwise, if \tcode{T} is specialization of \tcode{optional}, then \tcode{(static_cast<D>(F) == D() ? \placeholdernc{decay-copy}(E) : ((void)E, T()))}.
193
+
Otherwise, if \tcode{T} is a specialization of \tcode{optional} and \tcode{T} models \tcode{view}, then \tcode{(static_cast<D>(F) == D() ? \placeholdernc{decay-copy}(E) : ((void)E, T()))}.
193
194
\end{addedblock}
194
195
\item
195
196
Otherwise, if \tcode{T} models
@@ -263,9 +264,7 @@ \chapter{Wording}
263
264
for some type \tcode{X}, then \tcode{auto(views::empty<const X>)}.
264
265
\begin{addedblock}
265
266
\item
266
-
Otherwise, if \tcode{U} denotes \tcode{optional<X\&>} for some type \tcode{X} , then \tcode{optional<const X\&>(E)}.
267
-
\item
268
-
Otherwise, if \tcode{U} denotes \tcode{optional<X>} for some type \tcode{X} , then \tcode{optional<const X>(E)}.
267
+
Otherwise, if \tcode{U} denotes \tcode{optional<X\&>} for some type \tcode{X}, then \tcode{optional<const X\&>(E)}.
269
268
\end{addedblock}
270
269
\item
271
270
Otherwise,
@@ -308,7 +307,7 @@ \chapter{Wording}
308
307
then \tcode{E.base()}.
309
308
\begin{addedblock}
310
309
\item
311
-
Otherwise, if \tcode{T} is specialization of \tcode{optional}, then \placeholdernc{decay-copy}(E).
310
+
Otherwise, if \tcode{E} is specialization of \tcode{optional} and \tcode{E} models \tcode{view}, then \placeholdernc{decay-copy}(E).
312
311
\end{addedblock}
313
312
\item
314
313
Otherwise, if the type of \tcode{E} is \cv{} \tcode{subrange<reverse_iterator<I>, reverse_iterator<I>, K>}
0 commit comments