_LIBCPP_INLINE_VISIBILITY
constexpr
const value_type&
- operator*() const&
+ operator*() const& noexcept
{
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
return this->__get();
_LIBCPP_INLINE_VISIBILITY
constexpr
value_type&
- operator*() &
+ operator*() & noexcept
{
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
return this->__get();
_LIBCPP_INLINE_VISIBILITY
constexpr
value_type&&
- operator*() &&
+ operator*() && noexcept
{
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
return _VSTD::move(this->__get());
_LIBCPP_INLINE_VISIBILITY
constexpr
const value_type&&
- operator*() const&&
+ operator*() const&& noexcept
{
_LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
return _VSTD::move(this->__get());
{
optional<X> opt; ((void)opt);
ASSERT_SAME_TYPE(decltype(*opt), X&);
+ LIBCPP_STATIC_ASSERT(noexcept(*opt));
// ASSERT_NOT_NOEXCEPT(*opt);
// FIXME: This assertion fails with GCC because it can see that
// (A) operator*() is constexpr, and
{
const optional<X> opt; ((void)opt);
ASSERT_SAME_TYPE(decltype(*opt), X const&);
+ LIBCPP_STATIC_ASSERT(noexcept(*opt));
// ASSERT_NOT_NOEXCEPT(*opt);
// FIXME: This assertion fails with GCC because it can see that
// (A) operator*() is constexpr, and
{
const optional<X> opt; ((void)opt);
ASSERT_SAME_TYPE(decltype(*std::move(opt)), X const &&);
+ LIBCPP_STATIC_ASSERT(noexcept(*opt));
// ASSERT_NOT_NOEXCEPT(*std::move(opt));
// FIXME: This assertion fails with GCC because it can see that
// (A) operator*() is constexpr, and
{
optional<X> opt; ((void)opt);
ASSERT_SAME_TYPE(decltype(*std::move(opt)), X&&);
+ LIBCPP_STATIC_ASSERT(noexcept(*opt));
// ASSERT_NOT_NOEXCEPT(*std::move(opt));
// FIXME: This assertion fails with GCC because it can see that
// (A) operator*() is constexpr, and