tmp/tmphq58vl6g/{from.md → to.md}
RENAMED
|
@@ -6,10 +6,15 @@
|
|
| 6 |
namespace std {
|
| 7 |
// [optional.optional], class template optional
|
| 8 |
template<class T>
|
| 9 |
class optional;
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
// [optional.nullopt], no-value state indicator
|
| 12 |
struct nullopt_t{see below};
|
| 13 |
inline constexpr nullopt_t nullopt(unspecified);
|
| 14 |
|
| 15 |
// [optional.bad.access], class bad_optional_access
|
|
@@ -48,17 +53,18 @@ namespace std {
|
|
| 48 |
template<class T, class U> constexpr bool operator>(const T&, const optional<U>&);
|
| 49 |
template<class T, class U> constexpr bool operator<=(const optional<T>&, const U&);
|
| 50 |
template<class T, class U> constexpr bool operator<=(const T&, const optional<U>&);
|
| 51 |
template<class T, class U> constexpr bool operator>=(const optional<T>&, const U&);
|
| 52 |
template<class T, class U> constexpr bool operator>=(const T&, const optional<U>&);
|
| 53 |
-
template<class T,
|
|
|
|
| 54 |
constexpr compare_three_way_result_t<T, U>
|
| 55 |
operator<=>(const optional<T>&, const U&);
|
| 56 |
|
| 57 |
// [optional.specalg], specialized algorithms
|
| 58 |
template<class T>
|
| 59 |
-
void swap(optional<T>&, optional<T>&) noexcept(see below);
|
| 60 |
|
| 61 |
template<class T>
|
| 62 |
constexpr optional<see below> make_optional(T&&);
|
| 63 |
template<class T, class... Args>
|
| 64 |
constexpr optional<T> make_optional(Args&&... args);
|
|
|
|
| 6 |
namespace std {
|
| 7 |
// [optional.optional], class template optional
|
| 8 |
template<class T>
|
| 9 |
class optional;
|
| 10 |
|
| 11 |
+
template<class T>
|
| 12 |
+
concept is-derived-from-optional = requires(const T& t) { // exposition only
|
| 13 |
+
[]<class U>(const optional<U>&){ }(t);
|
| 14 |
+
};
|
| 15 |
+
|
| 16 |
// [optional.nullopt], no-value state indicator
|
| 17 |
struct nullopt_t{see below};
|
| 18 |
inline constexpr nullopt_t nullopt(unspecified);
|
| 19 |
|
| 20 |
// [optional.bad.access], class bad_optional_access
|
|
|
|
| 53 |
template<class T, class U> constexpr bool operator>(const T&, const optional<U>&);
|
| 54 |
template<class T, class U> constexpr bool operator<=(const optional<T>&, const U&);
|
| 55 |
template<class T, class U> constexpr bool operator<=(const T&, const optional<U>&);
|
| 56 |
template<class T, class U> constexpr bool operator>=(const optional<T>&, const U&);
|
| 57 |
template<class T, class U> constexpr bool operator>=(const T&, const optional<U>&);
|
| 58 |
+
template<class T, class U>
|
| 59 |
+
requires (!is-derived-from-optional<U>) && three_way_comparable_with<T, U>
|
| 60 |
constexpr compare_three_way_result_t<T, U>
|
| 61 |
operator<=>(const optional<T>&, const U&);
|
| 62 |
|
| 63 |
// [optional.specalg], specialized algorithms
|
| 64 |
template<class T>
|
| 65 |
+
constexpr void swap(optional<T>&, optional<T>&) noexcept(see below);
|
| 66 |
|
| 67 |
template<class T>
|
| 68 |
constexpr optional<see below> make_optional(T&&);
|
| 69 |
template<class T, class... Args>
|
| 70 |
constexpr optional<T> make_optional(Args&&... args);
|