#include <sol.hpp>
|
constexpr | optional () noexcept |
|
constexpr | optional (nullopt_t) noexcept |
|
| optional (const optional &rhs) |
|
| optional (const optional< T &> &rhs) |
|
| optional (optional &&rhs) noexcept(::std::is_nothrow_move_constructible< T >::value) |
|
constexpr | optional (const T &v) |
|
constexpr | optional (T &&v) |
|
template<class... Args> |
constexpr | optional (in_place_t, Args &&... args) |
|
template<class U , class... Args, TR2_OPTIONAL_REQUIRES(::std::is_constructible< T, ::std::initializer_list< U >>) > |
OPTIONAL_CONSTEXPR_INIT_LIST | optional (in_place_t, ::std::initializer_list< U > il, Args &&... args) |
|
| ~optional ()=default |
|
optional & | operator= (nullopt_t) noexcept |
|
optional & | operator= (const optional &rhs) |
|
optional & | operator= (optional &&rhs) noexcept(::std::is_nothrow_move_assignable< T >::value &&::std::is_nothrow_move_constructible< T >::value) |
|
template<class U > |
auto | operator= (U &&v) -> typename ::std::enable_if< ::std::is_same< typename ::std::decay< U >::type, T >::value, optional &>::type |
|
template<class... Args> |
void | emplace (Args &&... args) |
|
template<class U , class... Args> |
void | emplace (::std::initializer_list< U > il, Args &&... args) |
|
void | swap (optional< T > &rhs) noexcept(::std::is_nothrow_move_constructible< T >::value &&noexcept(swap(::std::declval< T &>(), ::std::declval< T &>()))) |
|
constexpr | operator bool () const noexcept |
|
constexpr T const * | operator-> () const |
|
T * | operator-> () |
|
constexpr T const & | operator* () const |
|
T & | operator* () |
|
constexpr T const & | value () const |
|
T & | value () |
|
template<class V > |
constexpr T | value_or (V &&v) const |
|
|
constexpr bool | initialized () const noexcept |
|
typename ::std::remove_const< T >::type * | dataptr () |
|
constexpr const T * | dataptr () const |
|
constexpr const T & | contained_val () const |
|
T & | contained_val () |
|
void | clear () noexcept |
|
template<class... Args> |
void | initialize (Args &&... args) noexcept(noexcept(T(::std::forward< Args >(args)...))) |
|
template<class U , class... Args> |
void | initialize (::std::initializer_list< U > il, Args &&... args) noexcept(noexcept(T(il, ::std::forward< Args >(args)...))) |
|
§ value_type
§ optional() [1/9]
3690 : OptionalBase<T>(){};
§ optional() [2/9]
3692 : OptionalBase<T>(){};
§ optional() [3/9]
3695 : OptionalBase<T>() {
3696 if (rhs.initialized()) {
3697 ::new (static_cast<void*>(
dataptr()))
T(*rhs);
typename ::std::remove_const< T >::type * dataptr()
Definition: sol.hpp:3630
typename ::std::conditional< ::std::is_trivially_destructible< T >::value, constexpr_optional_base< typename ::std::remove_const< T >::type >, optional_base< typename ::std::remove_const< T >::type >>::type OptionalBase
Definition: sol.hpp:3620
§ optional() [4/9]
3705 ::new (static_cast<void*>(
dataptr()))
T(*rhs);
typename ::std::remove_const< T >::type * dataptr()
Definition: sol.hpp:3630
typename ::std::conditional< ::std::is_trivially_destructible< T >::value, constexpr_optional_base< typename ::std::remove_const< T >::type >, optional_base< typename ::std::remove_const< T >::type >>::type OptionalBase
Definition: sol.hpp:3620
constexpr optional() noexcept
Definition: sol.hpp:3689
§ optional() [5/9]
3711 : OptionalBase<T>() {
3712 if (rhs.initialized()) {
3713 ::new (static_cast<void*>(
dataptr()))
T(::
std::move(*rhs));
typename ::std::remove_const< T >::type * dataptr()
Definition: sol.hpp:3630
typename ::std::conditional< ::std::is_trivially_destructible< T >::value, constexpr_optional_base< typename ::std::remove_const< T >::type >, optional_base< typename ::std::remove_const< T >::type >>::type OptionalBase
Definition: sol.hpp:3620
§ optional() [6/9]
3719 : OptionalBase<T>(v) {
§ optional() [7/9]
constexpr ::std::remove_reference< T >::type && constexpr_move(T &&t) noexcept
Definition: sol.hpp:3443
§ optional() [8/9]
template<class T>
template<class... Args>
3728 : OptionalBase<T>(
in_place, constexpr_forward<Args>(args)...) {
constexpr in_place_tag in_place(detail::in_place_of_tag)
Definition: sol.hpp:3223
§ optional() [9/9]
template<class T>
template<class U , class... Args, TR2_OPTIONAL_REQUIRES(::std::is_constructible< T, ::std::initializer_list< U >>) >
3733 : OptionalBase<T>(
in_place, il, constexpr_forward<Args>(args)...) {
constexpr in_place_tag in_place(detail::in_place_of_tag)
Definition: sol.hpp:3223
§ ~optional()
§ clear()
3668 OptionalBase<T>::init_ =
false;
typename ::std::remove_const< T >::type * dataptr()
Definition: sol.hpp:3630
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
§ contained_val() [1/2]
3658 return OptionalBase<T>::storage();
§ contained_val() [2/2]
3661 return OptionalBase<T>::storage();
§ dataptr() [1/2]
3631 return ::std::addressof(OptionalBase<T>::storage());
§ dataptr() [2/2]
constexpr T * static_addressof(T &ref)
Definition: sol.hpp:3472
§ emplace() [1/2]
template<class T>
template<class... Args>
void initialize(Args &&... args) noexcept(noexcept(T(::std::forward< Args >(args)...)))
Definition: sol.hpp:3672
void clear() noexcept
Definition: sol.hpp:3665
§ emplace() [2/2]
template<class T>
template<class U , class... Args>
void sol::optional< T >::emplace |
( |
::std::initializer_list< U > |
il, |
|
|
Args &&... |
args |
|
) |
| |
|
inline |
3788 initialize<U, Args...>(il, ::std::forward<Args>(args)...);
void initialize(Args &&... args) noexcept(noexcept(T(::std::forward< Args >(args)...)))
Definition: sol.hpp:3672
void clear() noexcept
Definition: sol.hpp:3665
§ initialize() [1/2]
template<class T>
template<class... Args>
3673 assert(!OptionalBase<T>::init_);
3674 ::new (static_cast<void*>(
dataptr()))
T(::
std::forward<Args>(args)...);
typename ::std::remove_const< T >::type * dataptr()
Definition: sol.hpp:3630
typename ::std::conditional< ::std::is_trivially_destructible< T >::value, constexpr_optional_base< typename ::std::remove_const< T >::type >, optional_base< typename ::std::remove_const< T >::type >>::type OptionalBase
Definition: sol.hpp:3620
§ initialize() [2/2]
template<class T>
template<class U , class... Args>
void sol::optional< T >::initialize |
( |
::std::initializer_list< U > |
il, |
|
|
Args &&... |
args |
|
) |
| |
|
inlineprivatenoexcept |
3680 assert(!OptionalBase<T>::init_);
3681 ::new (static_cast<void*>(
dataptr()))
T(il, ::
std::forward<Args>(args)...);
typename ::std::remove_const< T >::type * dataptr()
Definition: sol.hpp:3630
typename ::std::conditional< ::std::is_trivially_destructible< T >::value, constexpr_optional_base< typename ::std::remove_const< T >::type >, optional_base< typename ::std::remove_const< T >::type >>::type OptionalBase
Definition: sol.hpp:3620
§ initialized()
3628 return OptionalBase<T>::init_;
§ operator bool()
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
§ operator*() [1/2]
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
constexpr const T & contained_val() const
Definition: sol.hpp:3657
#define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR)
Definition: sol.hpp:3450
§ operator*() [2/2]
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
constexpr const T & contained_val() const
Definition: sol.hpp:3657
§ operator->() [1/2]
typename ::std::remove_const< T >::type * dataptr()
Definition: sol.hpp:3630
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
#define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR)
Definition: sol.hpp:3450
§ operator->() [2/2]
typename ::std::remove_const< T >::type * dataptr()
Definition: sol.hpp:3630
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
§ operator=() [1/4]
void clear() noexcept
Definition: sol.hpp:3665
§ operator=() [2/4]
3746 if (
initialized() ==
true && rhs.initialized() ==
false)
3748 else if (
initialized() ==
false && rhs.initialized() ==
true)
3750 else if (
initialized() ==
true && rhs.initialized() ==
true)
void initialize(Args &&... args) noexcept(noexcept(T(::std::forward< Args >(args)...)))
Definition: sol.hpp:3672
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
constexpr const T & contained_val() const
Definition: sol.hpp:3657
void clear() noexcept
Definition: sol.hpp:3665
§ operator=() [3/4]
3756 if (
initialized() ==
true && rhs.initialized() ==
false)
3758 else if (
initialized() ==
false && rhs.initialized() ==
true)
3760 else if (
initialized() ==
true && rhs.initialized() ==
true)
void initialize(Args &&... args) noexcept(noexcept(T(::std::forward< Args >(args)...)))
Definition: sol.hpp:3672
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
constexpr const T & contained_val() const
Definition: sol.hpp:3657
void clear() noexcept
Definition: sol.hpp:3665
§ operator=() [4/4]
template<class T>
template<class U >
void initialize(Args &&... args) noexcept(noexcept(T(::std::forward< Args >(args)...)))
Definition: sol.hpp:3672
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
constexpr const T & contained_val() const
Definition: sol.hpp:3657
§ swap()
3793 if (
initialized() ==
true && rhs.initialized() ==
false) {
3794 rhs.initialize(::std::move(**
this));
3797 else if (
initialized() ==
false && rhs.initialized() ==
true) {
3801 else if (
initialized() ==
true && rhs.initialized() ==
true) {
void swap(optional< T > &rhs) noexcept(::std::is_nothrow_move_constructible< T >::value &&noexcept(swap(::std::declval< T &>(), ::std::declval< T &>())))
Definition: sol.hpp:3792
void initialize(Args &&... args) noexcept(noexcept(T(::std::forward< Args >(args)...)))
Definition: sol.hpp:3672
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
void swap(optional< T > &x, optional< T > &y) noexcept(noexcept(x.swap(y)))
Definition: sol.hpp:4327
void clear() noexcept
Definition: sol.hpp:3665
§ value() [1/2]
3887 #ifdef SOL_NO_EXCEPTIONS 3890 : *
static_cast<T*
>(
nullptr);
3892 : (
throw bad_optional_access(
"bad optional access"),
contained_val());
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
constexpr const T & contained_val() const
Definition: sol.hpp:3657
§ value() [2/2]
3898 #ifdef SOL_NO_EXCEPTIONS 3901 : (std::abort(), *
static_cast<T*
>(
nullptr));
3903 : (
throw bad_optional_access(
"bad optional access"),
contained_val());
constexpr bool initialized() const noexcept
Definition: sol.hpp:3627
constexpr const T & contained_val() const
Definition: sol.hpp:3657
§ value_or()
template<class T>
template<class V >
3936 return *
this ? **
this : detail_::convert<T>(constexpr_forward<V>(v));
The documentation for this class was generated from the following file: