forked from TartanLlama/optional
Remove rvalue observers for optional<T&>
This commit is contained in:
@ -2214,19 +2214,11 @@ public:
|
|||||||
/// \requires a value is stored
|
/// \requires a value is stored
|
||||||
/// \group deref
|
/// \group deref
|
||||||
/// \synopsis constexpr T &operator*();
|
/// \synopsis constexpr T &operator*();
|
||||||
TL_OPTIONAL_11_CONSTEXPR T &operator*() & { return *m_value; }
|
TL_OPTIONAL_11_CONSTEXPR T &operator*() { return *m_value; }
|
||||||
|
|
||||||
/// \group deref
|
/// \group deref
|
||||||
/// \synopsis constexpr const T &operator*() const;
|
/// \synopsis constexpr const T &operator*() const;
|
||||||
constexpr const T &operator*() const & { return *m_value; }
|
constexpr const T &operator*() const { return *m_value; }
|
||||||
|
|
||||||
/// \exclude
|
|
||||||
TL_OPTIONAL_11_CONSTEXPR T &&operator*() && { return std::move(*m_value); }
|
|
||||||
|
|
||||||
#ifndef TL_OPTIONAL_NO_CONSTRR
|
|
||||||
/// \exclude
|
|
||||||
constexpr const T &&operator*() const && { return std::move(*m_value); }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// \returns whether or not the optional has a value
|
/// \returns whether or not the optional has a value
|
||||||
/// \group has_value
|
/// \group has_value
|
||||||
@ -2241,33 +2233,18 @@ public:
|
|||||||
/// [bad_optional_access]
|
/// [bad_optional_access]
|
||||||
/// \group value
|
/// \group value
|
||||||
/// synopsis constexpr T &value();
|
/// synopsis constexpr T &value();
|
||||||
TL_OPTIONAL_11_CONSTEXPR T &value() & {
|
TL_OPTIONAL_11_CONSTEXPR T &value() {
|
||||||
if (has_value())
|
if (has_value())
|
||||||
return *m_value;
|
return *m_value;
|
||||||
throw bad_optional_access();
|
throw bad_optional_access();
|
||||||
}
|
}
|
||||||
/// \group value
|
/// \group value
|
||||||
/// \synopsis constexpr const T &value() const;
|
/// \synopsis constexpr const T &value() const;
|
||||||
TL_OPTIONAL_11_CONSTEXPR const T &value() const & {
|
TL_OPTIONAL_11_CONSTEXPR const T &value() const {
|
||||||
if (has_value())
|
if (has_value())
|
||||||
return *m_value;
|
return *m_value;
|
||||||
throw bad_optional_access();
|
throw bad_optional_access();
|
||||||
}
|
}
|
||||||
/// \exclude
|
|
||||||
TL_OPTIONAL_11_CONSTEXPR T &&value() && {
|
|
||||||
if (has_value())
|
|
||||||
return std::move(*m_value);
|
|
||||||
throw bad_optional_access();
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef TL_OPTIONAL_NO_CONSTRR
|
|
||||||
/// \exclude
|
|
||||||
constexpr const T &&value() const && {
|
|
||||||
if (has_value())
|
|
||||||
return std::move(*m_value);
|
|
||||||
throw bad_optional_access();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// \returns the stored value if there is one, otherwise returns `u`
|
/// \returns the stored value if there is one, otherwise returns `u`
|
||||||
/// \group value_or
|
/// \group value_or
|
||||||
|
Reference in New Issue
Block a user