| 343 | // otherwise returns default `v'. |
| 344 | template <typename U> |
| 345 | constexpr T value_or(U&& v) const& { |
| 346 | static_assert(std::is_copy_constructible<value_type>::value, |
| 347 | "T can not be copy constructible"); |
| 348 | static_assert(std::is_convertible<U&&, value_type>::value, |
| 349 | "U can not be convertible to T"); |
| 350 | |
| 351 | return static_cast<bool>(*this) ? **this : static_cast<T>(std::forward<U>(v)); |
| 352 | } |
| 353 | template <typename U> |
| 354 | T value_or(U&& v) && { |
| 355 | static_assert(std::is_move_constructible<value_type>::value, |