|
| template<class F > |
| SOL_TL_OPTIONAL_11_CONSTEXPR detail::invoke_result_t< F, T & > | and_then (F &&f) & |
| |
| template<class F > |
| SOL_TL_OPTIONAL_11_CONSTEXPR detail::invoke_result_t< F, T & > | and_then (F &&f) && |
| |
| template<class F > |
| constexpr detail::invoke_result_t< F, const T & > | and_then (F &&f) const & |
| |
| template<class F > |
| constexpr detail::invoke_result_t< F, const T & > | and_then (F &&f) const && |
| |
| template<class U > |
| constexpr optional< typename std::decay< U >::type > | conjunction (U &&u) const |
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR optional | disjunction (const optional &rhs) & |
| |
| constexpr optional | disjunction (const optional &rhs) const & |
| | disjunction More...
|
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR optional | disjunction (const optional &rhs) && |
| | disjunction More...
|
| |
| constexpr optional | disjunction (const optional &rhs) const && |
| | disjunction More...
|
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR optional | disjunction (optional &&rhs) & |
| | disjunction More...
|
| |
| constexpr optional | disjunction (optional &&rhs) const & |
| | disjunction More...
|
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR optional | disjunction (optional &&rhs) && |
| | disjunction More...
|
| |
| constexpr optional | disjunction (optional &&rhs) const && |
| | disjunction More...
|
| |
| template<class... Args> |
| T & | emplace (Args &&... args) noexcept |
| |
| constexpr bool | has_value () const noexcept |
| |
| template<class F , class U > |
| U | map_or (F &&f, U &&u) & |
| | Maps the stored value with f if there is one, otherwise returns u. More...
|
| |
| template<class F , class U > |
| U | map_or (F &&f, U &&u) && |
| | map_or More...
|
| |
| template<class F , class U > |
| U | map_or (F &&f, U &&u) const & |
| | map_or More...
|
| |
| template<class F , class U > |
| U | map_or (F &&f, U &&u) const && |
| | map_or More...
|
| |
| template<class F , class U > |
| detail::invoke_result_t< U > | map_or_else (F &&f, U &&u) & |
| | Maps the stored value with f if there is one, otherwise calls u and returns the result. More...
|
| |
| template<class F , class U > |
| detail::invoke_result_t< U > | map_or_else (F &&f, U &&u) && |
| |
| template<class F , class U > |
| detail::invoke_result_t< U > | map_or_else (F &&f, U &&u) const & |
| |
| template<class F , class U > |
| detail::invoke_result_t< U > | map_or_else (F &&f, U &&u) const && |
| |
| constexpr | operator bool () const noexcept |
| | has_value More...
|
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR T & | operator* () |
| |
| constexpr const T & | operator* () const |
| |
| constexpr const T * | operator-> () const |
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR T * | operator-> () |
| |
| optional & | operator= (nullopt_t) noexcept |
| |
| optional & | operator= (const optional &rhs)=default |
| |
| template<class U = T, detail::enable_if_t<!detail::is_optional< detail::decay_t< U >>::value > * = nullptr> |
| optional & | operator= (U &&u) |
| |
| template<class U > |
| optional & | operator= (const optional< U > &rhs) |
| |
| constexpr | optional () noexcept |
| |
| constexpr | optional (nullopt_t) noexcept |
| | ctor_empty More...
|
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR | optional (const optional &rhs) noexcept=default |
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR | optional (optional &&rhs)=default |
| |
| template<class U = T, detail::enable_if_t<!detail::is_optional< detail::decay_t< U >>::value > * = nullptr> |
| constexpr | optional (U &&u) |
| |
| template<class U > |
| constexpr | optional (const optional< U > &rhs) |
| |
| template<class F , detail::enable_if_ret_void< F > * = nullptr> |
| optional< T > SOL_TL_OPTIONAL_11_CONSTEXPR | or_else (F &&f) & |
| | Calls f if the optional is empty std::invoke_result_t<F> must be void or convertible to optional<T>. If *this has a value, returns *this. Otherwise, if f returns void, calls std::forward<F>(f) and returns std::nullopt. Otherwise, returns std::forward<F>(f)(). More...
|
| |
| template<class F , detail::disable_if_ret_void< F > * = nullptr> |
| optional< T > SOL_TL_OPTIONAL_11_CONSTEXPR | or_else (F &&f) & |
| |
| template<class F , detail::enable_if_ret_void< F > * = nullptr> |
| optional< T > | or_else (F &&f) && |
| |
| template<class F , detail::disable_if_ret_void< F > * = nullptr> |
| optional< T > SOL_TL_OPTIONAL_11_CONSTEXPR | or_else (F &&f) && |
| |
| template<class F , detail::enable_if_ret_void< F > * = nullptr> |
| optional< T > | or_else (F &&f) const & |
| |
| template<class F , detail::disable_if_ret_void< F > * = nullptr> |
| optional< T > SOL_TL_OPTIONAL_11_CONSTEXPR | or_else (F &&f) const & |
| |
| template<class F , detail::enable_if_ret_void< F > * = nullptr> |
| optional< T > | or_else (F &&f) const && |
| |
| template<class F , detail::disable_if_ret_void< F > * = nullptr> |
| optional< T > | or_else (F &&f) const && |
| |
| void | reset () noexcept |
| | Destroys the stored value if one exists, making the optional empty. More...
|
| |
| void | swap (optional &rhs) noexcept |
| |
| optional | take () & |
| |
| optional | take () const & |
| | take More...
|
| |
| optional | take () && |
| | take More...
|
| |
| optional | take () const && |
| | take More...
|
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR T & | value () |
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR const T & | value () const |
| |
| template<class U > |
| constexpr T & | value_or (U &&u) const |
| |
| | ~optional ()=default |
| | No-op. More...
|
| |
template<class T>
class sol::optional< T & >
Specialization for when T is a reference. optional<T&> acts similarly to a T*, but provides more operations and shows intent more clearly.
Examples:
int i = 42;
*o == 42;
i = 12;
*o = 12;
&*o == &i;
Assignment has rebind semantics rather than assign-through semantics:
int j = 8;
o = j;
&*o == &j;
Definition at line 6265 of file sol.hpp.