|
| 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 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 && |
| |
| 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
|
| |
|
template<class F , class U > |
| U | map_or (F &&f, U &&u) const & |
| | map_or
|
| |
|
template<class F , class U > |
| U | map_or (F &&f, U &&u) const && |
| | map_or
|
| |
| 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 && |
| |
| 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
|
| |
|
SOL_TL_OPTIONAL_11_CONSTEXPR optional | disjunction (const optional &rhs) && |
| | disjunction
|
| |
|
constexpr optional | disjunction (const optional &rhs) const && |
| | disjunction
|
| |
|
SOL_TL_OPTIONAL_11_CONSTEXPR optional | disjunction (optional &&rhs) & |
| | disjunction
|
| |
|
constexpr optional | disjunction (optional &&rhs) const & |
| | disjunction
|
| |
|
SOL_TL_OPTIONAL_11_CONSTEXPR optional | disjunction (optional &&rhs) && |
| | disjunction
|
| |
|
constexpr optional | disjunction (optional &&rhs) const && |
| | disjunction
|
| |
| optional | take () & |
| |
|
optional | take () const & |
| | take
|
| |
|
optional | take () && |
| | take
|
| |
|
optional | take () const && |
| | take
|
| |
| constexpr | optional () noexcept=default |
| |
|
constexpr | optional (nullopt_t) noexcept |
| | ctor_empty
|
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR | optional (const optional &rhs)=default |
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR | optional (optional &&rhs)=default |
| |
| template<class... Args> |
| constexpr | optional (detail::enable_if_t< std::is_constructible< T, Args... >::value, in_place_t >, Args &&... args) |
| |
| template<class U , class... Args> |
| SOL_TL_OPTIONAL_11_CONSTEXPR | optional (detail::enable_if_t< std::is_constructible< T, std::initializer_list< U > &, Args &&... >::value, in_place_t >, std::initializer_list< U > il, Args &&... args) |
| |
| constexpr | optional (T &&u) |
| |
|
constexpr | optional (const T &u) |
| |
| template<class U , detail::enable_from_other< T, U, const U &> * = nullptr, detail::enable_if_t< std::is_convertible< const U &, T >::value > * = nullptr> |
| | optional (const optional< U > &rhs) |
| |
|
template<class U , detail::enable_from_other< T, U, const U &> * = nullptr, detail::enable_if_t<!std::is_convertible< const U &, T >::value > * = nullptr> |
| | optional (const optional< U > &rhs) |
| |
| template<class U , detail::enable_from_other< T, U, U &&> * = nullptr, detail::enable_if_t< std::is_convertible< U &&, T >::value > * = nullptr> |
| | optional (optional< U > &&rhs) |
| |
|
template<class U , detail::enable_from_other< T, U, U &&> * = nullptr, detail::enable_if_t<!std::is_convertible< U &&, T >::value > * = nullptr> |
| | optional (optional< U > &&rhs) |
| |
|
| ~optional ()=default |
| | Destroys the stored value if there is one.
|
| |
| optional & | operator= (nullopt_t) noexcept |
| |
| optional & | operator= (const optional &rhs)=default |
| |
| optional & | operator= (optional &&rhs)=default |
| |
| template<class U = T, detail::enable_assign_forward< T, U > * = nullptr> |
| optional & | operator= (U &&u) |
| |
| template<class U , detail::enable_assign_from_other< T, U, const U &> * = nullptr> |
| optional & | operator= (const optional< U > &rhs) |
| |
| template<class U , detail::enable_assign_from_other< T, U, U > * = nullptr> |
| optional & | operator= (optional< U > &&rhs) |
| |
| template<class... Args> |
| T & | emplace (Args &&... args) |
| |
| template<class U , class... Args> |
| detail::enable_if_t< std::is_constructible< T, std::initializer_list< U > &, Args &&... >::value, T & > | emplace (std::initializer_list< U > il, Args &&... args) |
| |
| void | swap (optional &rhs) noexcept(std::is_nothrow_move_constructible< T >::value &&detail::is_nothrow_swappable< T >::value) |
| |
| constexpr const T * | operator-> () const |
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR T * | operator-> () |
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR T & | operator* () & |
| |
| constexpr const T & | operator* () const & |
| |
|
SOL_TL_OPTIONAL_11_CONSTEXPR T && | operator* () && |
| |
|
constexpr const T && | operator* () const && |
| |
| constexpr bool | has_value () const noexcept |
| |
|
constexpr | operator bool () const noexcept |
| | has_value
|
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR T & | value () & |
| |
| SOL_TL_OPTIONAL_11_CONSTEXPR const T & | value () const & |
| |
|
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 & |
| |
|
template<class U > |
| SOL_TL_OPTIONAL_11_CONSTEXPR T | value_or (U &&u) && |
| | value_or
|
| |
|
void | reset () noexcept |
| | Destroys the stored value if one exists, making the optional empty.
|
| |
template<class T>
class sol::optional< T >
An optional object is an object that contains the storage for another object and manages the lifetime of this contained object, if any. The contained object may be initialized after the optional object has been initialized, and may be destroyed before the optional object has been destroyed. The initialization state of the contained object is tracked by the optional object.