@@ -544,18 +544,19 @@ class optional {
544
544
using U = std::invoke_result_t <F, T&&>;
545
545
static_assert (!std::is_array_v<U>, " U must not be an array" );
546
546
static_assert (!std::is_same_v<U, in_place_t >, " U must not be an inplace type" );
547
- static_assert (!std::is_same_v<U, nullopt_t >, " U must not be null_opt type" );
547
+ static_assert (!std::is_same_v<U, nullopt_t >, " U must not be nullopt_t type" );
548
548
static_assert (std::is_object_v<U> || std::is_reference_v<U>, " U must be either an objecy or a reference" ); // / References now allowed
549
549
return (has_value ()) ? optional<U>{std::invoke (std::forward<F>(f), std::move (value_))} : optional<U>{};
550
550
}
551
551
552
552
template <class F >
553
553
constexpr auto transform (F&& f) const & {
554
554
using U = std::invoke_result_t <F, const T&>;
555
- static_assert (!std::is_array_v<U>);
556
- static_assert (!std::is_same_v<U, in_place_t >);
557
- static_assert (!std::is_same_v<U, nullopt_t >);
558
- static_assert (std::is_object_v<U> || std::is_reference_v<U>); // / References now allowed
555
+ static_assert (!std::is_array_v<U>, " U must not be an array" );
556
+ static_assert (!std::is_same_v<U, in_place_t >, " U must not be an inplace type" );
557
+ static_assert (!std::is_same_v<U, nullopt_t >, " U must not be nullopt_t type" );
558
+ static_assert (std::is_object_v<U> || std::is_reference_v<U>,
559
+ " U must be either an objecy or a reference" ); // / References now allowed
559
560
return (has_value ()) ? optional<U>{std::invoke (std::forward<F>(f), value_)} : optional<U>{};
560
561
}
561
562
0 commit comments