File tree Expand file tree Collapse file tree 1 file changed +13
-19
lines changed
Expand file tree Collapse file tree 1 file changed +13
-19
lines changed Original file line number Diff line number Diff line change @@ -91,29 +91,11 @@ This wording is relative to <paper num="N5014"/>.
9191
9292<ol >
9393
94- <li ><p >Modify <sref ref =" [optional.optional.ref.general]" />, header <tt >< iterator> </tt > synopsis, as indicated:</p >
95-
96- <blockquote >
97- <pre >
98- namespace std {
99- template< class T>
100- class optional< T&> {
101- [… ]
102- constexpr T& value() const; // freestanding-deleted
103- template< class U = remove_cv_t< T>>
104- constexpr <ins >decay_t</ins ><del >remove_cv_t</del >< T> value_or(U&& u) const;
105- [… ]
106- };
107- }
108- </pre >
109- </blockquote >
110- </li >
111-
11294<li ><p >Modify <sref ref =" [optional.ref.observe]" /> as indicated:</p >
11395
11496<blockquote >
11597<pre >
116- template< class U = remove_cv_t< T>> constexpr < ins >decay_t</ ins >< del > remove_cv_t</ del > < T> value_or(U&& u) const;
98+ template< class U = remove_cv_t< T>> constexpr remove_cv_t< T> value_or(U&& u) const;
11799</pre >
118100<blockquote >
119101<p >
@@ -132,6 +114,18 @@ template<class U = remove_cv_t<T>> constexpr <ins>decay_t</ins><del>
132114<blockquote ><pre >
133115return has_value() ? *<i >val</i > : static_cast< X> (std::forward< U> (u));
134116</pre ></blockquote >
117+ <p >
118+ <ins >
119+ -?- <i >Remarks</i >:
120+ The return type is unspecified if `T` is an array type or a non-object type.
121+ [<i >Note ?</i >: For example,
122+ <code >decay_t< T> </code > or
123+ <code >conditional_t< is_object_v< T> && !is_array_v< T> ,
124+ remove_cvref_t< T> , void> </code >
125+ could be used to avoid the declaration being ill-formed.
126+ <i >— end note</i >]
127+ </ins >
128+ </p >
135129</blockquote >
136130</blockquote >
137131</li >
You can’t perform that action at this time.
0 commit comments