Skip to content

Commit 4328c2b

Browse files
committed
Update workding for modeling views
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).
1 parent 615306d commit 4328c2b

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

papers/P2988/optional_range_optimization.tex

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,20 @@ \chapter{Design}
5454

5555
\section{views::as_const}
5656

57-
return optional or optional<const U\&> (if T is U\&)
57+
Return \tcode{optional}.
5858

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>}.
5960
\section{views::take(opt, n)}
6061

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.
6263

6364
\section{views::drop(opt, n)}
6465

65-
empty optional if n greater than zero, opt otherwise
66+
Empty \tcode{optional} if \tcode{n} greater than zero, \tcode{optional} otherwise.
6667

6768
\section{views::reverse}
6869

69-
input unchanged
70+
Input is returned unchanged.
7071

7172
\chapter{Wording}
7273
The proposed changes are relative to the current working draft \cite{N5014}.
@@ -106,7 +107,7 @@ \chapter{Wording}
106107
are indeterminately sequenced.
107108
\begin{addedblock}
108109
\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))}.
110111
\end{addedblock}
111112
\item
112113
Otherwise, if \tcode{T} models
@@ -189,7 +190,7 @@ \chapter{Wording}
189190
are indeterminately sequenced.
190191
\begin{addedblock}
191192
\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()))}.
193194
\end{addedblock}
194195
\item
195196
Otherwise, if \tcode{T} models
@@ -263,9 +264,7 @@ \chapter{Wording}
263264
for some type \tcode{X}, then \tcode{auto(views::empty<const X>)}.
264265
\begin{addedblock}
265266
\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)}.
269268
\end{addedblock}
270269
\item
271270
Otherwise,
@@ -308,7 +307,7 @@ \chapter{Wording}
308307
then \tcode{E.base()}.
309308
\begin{addedblock}
310309
\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).
312311
\end{addedblock}
313312
\item
314313
Otherwise, if the type of \tcode{E} is \cv{} \tcode{subrange<reverse_iterator<I>, reverse_iterator<I>, K>}

0 commit comments

Comments
 (0)