Skip to content

Commit 0c61219

Browse files
more messages
1 parent b54cf84 commit 0c61219

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

include/beman/optional26/optional.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -544,18 +544,19 @@ class optional {
544544
using U = std::invoke_result_t<F, T&&>;
545545
static_assert(!std::is_array_v<U>, "U must not be an array");
546546
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");
548548
static_assert(std::is_object_v<U> || std::is_reference_v<U>, "U must be either an objecy or a reference"); /// References now allowed
549549
return (has_value()) ? optional<U>{std::invoke(std::forward<F>(f), std::move(value_))} : optional<U>{};
550550
}
551551

552552
template <class F>
553553
constexpr auto transform(F&& f) const& {
554554
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
559560
return (has_value()) ? optional<U>{std::invoke(std::forward<F>(f), value_)} : optional<U>{};
560561
}
561562

0 commit comments

Comments
 (0)