constexpr T& value() &;
constexpr const T & value() const &;
constexpr T&& value() &&;
constexpr const T&& value() const &&;
Returns the contained value.
1) Equivalent to return bool(*this) ? *val : throw bad_optional_access();.
2) Equivalent to return bool(*this) ? std::move(*val) : throw bad_optional_access();.
[edit] Parameters(none)
[edit] Return valueA reference to the contained value.
[edit] Exceptionsstd::experimental::bad_optional_access if *this does not contain a value.
[edit] NotesThe dereference operator operator*() does not check if this optional contains a value, which may be more efficient than value()
.
Possible output:
optional<T>::value: not engaged[edit] See also returns the contained value if available, another value otherwise
(library fundamentals TS)
exception indicating checked access to an optional that doesn't contain a valueRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4