|
3131 | 3131 | class optional;
|
3132 | 3132 |
|
3133 | 3133 | template<class T>
|
3134 |
| - constexpr bool @\exposid{is-optional}@ = false; // \expos |
3135 |
| - template<class T> |
3136 |
| - constexpr bool @\exposid{is-optional}@<optional<T>> = true; // \expos |
| 3134 | + concept @\defexposconcept{is-derived-from-optional}@ = requires(const T& t) { // \expos |
| 3135 | + []<class U>(const optional<U>&){ }(t); |
| 3136 | + }; |
3137 | 3137 |
|
3138 | 3138 | // \ref{optional.nullopt}, no-value state indicator
|
3139 | 3139 | struct nullopt_t{@\seebelow@};
|
|
3177 | 3177 | template<class T, class U> constexpr bool operator<=(const T&, const optional<U>&);
|
3178 | 3178 | template<class T, class U> constexpr bool operator>=(const optional<T>&, const U&);
|
3179 | 3179 | template<class T, class U> constexpr bool operator>=(const T&, const optional<U>&);
|
3180 |
| - template<class T, class U> requires (!@\exposid{is-optional}@<U>) && @\libconcept{three_way_comparable_with}@<T, U> |
| 3180 | + template<class T, class U> |
| 3181 | + requires (!@\exposconcept{is-derived-from-optional}@<U>) && @\libconcept{three_way_comparable_with}@<T, U> |
3181 | 3182 | constexpr compare_three_way_result_t<T, U>
|
3182 | 3183 | operator<=>(const optional<T>&, const U&);
|
3183 | 3184 |
|
|
4748 | 4749 |
|
4749 | 4750 | \indexlibrarymember{operator<=>}{optional}%
|
4750 | 4751 | \begin{itemdecl}
|
4751 |
| -template<class T, class U> requires (!@\exposid{is-optional}@<U>) && @\libconcept{three_way_comparable_with}@<T, U> |
| 4752 | +template<class T, class U> |
| 4753 | + requires (!@\exposconcept{is-derived-from-optional}@<U>) && @\libconcept{three_way_comparable_with}@<T, U> |
4752 | 4754 | constexpr compare_three_way_result_t<T, U>
|
4753 | 4755 | operator<=>(const optional<T>& x, const U& v);
|
4754 | 4756 | \end{itemdecl}
|
|
0 commit comments