@@ -287,9 +287,9 @@ concept enable_assign_from_other =
287
287
288
288
template <class T >
289
289
class optional {
290
- static_assert (
291
- (!std::is_same_v<T, std:: remove_cv_t < in_place_t >>)&& (!std::is_same_v<std::remove_cv_t <T>, nullopt_t >),
292
- " T must not be in_place_t or nullopt_t" );
290
+ static_assert ((!std::is_same_v<T, std:: remove_cv_t < in_place_t >>) &&
291
+ (!std::is_same_v<std::remove_cv_t <T>, nullopt_t >),
292
+ " T must not be in_place_t or nullopt_t" );
293
293
294
294
struct empty {};
295
295
union {
@@ -536,7 +536,8 @@ class optional {
536
536
static_assert (!std::is_array_v<U>, " U must not be an array" );
537
537
static_assert (!std::is_same_v<U, in_place_t >, " U must not be an inplace type" );
538
538
static_assert (!std::is_same_v<U, nullopt_t >, " U must not be nullopt_t" );
539
- static_assert (std::is_object_v<U> || std::is_reference_v<U>, " U must be either an object or a reference" ); // / References now allowed
539
+ static_assert (std::is_object_v<U> || std::is_reference_v<U>,
540
+ " U must be either an object or a reference" ); // / References now allowed
540
541
return (has_value ()) ? optional<U>{std::invoke (std::forward<F>(f), value_)} : optional<U>{};
541
542
}
542
543
@@ -546,7 +547,8 @@ class optional {
546
547
static_assert (!std::is_array_v<U>, " U must not be an array" );
547
548
static_assert (!std::is_same_v<U, in_place_t >, " U must not be an inplace type" );
548
549
static_assert (!std::is_same_v<U, nullopt_t >, " U must not be nullopt_t type" );
549
- static_assert (std::is_object_v<U> || std::is_reference_v<U>, " U must be either an objecy or a reference" ); // / References now allowed
550
+ static_assert (std::is_object_v<U> || std::is_reference_v<U>,
551
+ " U must be either an objecy or a reference" ); // / References now allowed
550
552
return (has_value ()) ? optional<U>{std::invoke (std::forward<F>(f), std::move (value_))} : optional<U>{};
551
553
}
552
554
0 commit comments