#include <optional.hpp>
Public Types | |
using | value_type = T |
Public Member Functions | |
template<class F > | |
TL_OPTIONAL_11_CONSTEXPR detail::invoke_result_t< F, T & > | and_then (F &&f) & |
template<class F > | |
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 |
Returns u if *this has a value, otherwise an empty optional. More... | |
TL_OPTIONAL_11_CONSTEXPR optional | disjunction (const optional &rhs) & |
Returns rhs if *this is empty, otherwise the current value. More... | |
TL_OPTIONAL_11_CONSTEXPR optional | disjunction (const optional &rhs) && |
constexpr optional | disjunction (const optional &rhs) const & |
constexpr optional | disjunction (const optional &rhs) const && |
TL_OPTIONAL_11_CONSTEXPR optional | disjunction (optional &&rhs) & |
TL_OPTIONAL_11_CONSTEXPR optional | disjunction (optional &&rhs) && |
constexpr optional | disjunction (optional &&rhs) const & |
constexpr optional | disjunction (optional &&rhs) const && |
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) |
constexpr bool | has_value () const noexcept |
Returns whether or not the optional has a value. More... | |
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) && |
template<class F , class U > | |
U | map_or (F &&f, U &&u) const & |
template<class F , class U > | |
U | map_or (F &&f, U &&u) const && |
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) && |
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 |
TL_OPTIONAL_11_CONSTEXPR T & | operator* () & |
Returns the stored value. More... | |
TL_OPTIONAL_11_CONSTEXPR T && | operator* () && |
constexpr const T & | operator* () const & |
constexpr const T && | operator* () const && |
TL_OPTIONAL_11_CONSTEXPR T * | operator-> () |
constexpr const T * | operator-> () const |
Returns a pointer to the stored value. More... | |
optional & | operator= (const optional &rhs)=default |
template<class U , detail::enable_assign_from_other< T, U, const U & > * = nullptr> | |
optional & | operator= (const optional< U > &rhs) |
optional & | operator= (nullopt_t) noexcept |
optional & | operator= (optional &&rhs)=default |
template<class U , detail::enable_assign_from_other< T, U, U > * = nullptr> | |
optional & | operator= (optional< U > &&rhs) |
template<class U = T, detail::enable_assign_forward< T, U > * = nullptr> | |
optional & | operator= (U &&u) |
constexpr | optional () noexcept=default |
Constructs an optional that does not contain a value. More... | |
TL_OPTIONAL_11_CONSTEXPR | optional (const optional &rhs)=default |
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) | |
Converting copy constructor. More... | |
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... Args> | |
constexpr | optional (detail::enable_if_t< std::is_constructible< T, Args... >::value, in_place_t >, Args &&... args) |
Constructs the stored value in-place using the given arguments. More... | |
template<class U , class... Args> | |
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 (nullopt_t) noexcept |
TL_OPTIONAL_11_CONSTEXPR | optional (optional &&rhs)=default |
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) | |
Converting move constructor. More... | |
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 = T, detail::enable_if_t< std::is_convertible< U &&, T >::value > * = nullptr, detail::enable_forward_value< T, U > * = nullptr> | |
constexpr | optional (U &&u) |
Constructs the stored value with u . More... | |
template<class U = T, detail::enable_if_t<!std::is_convertible< U &&, T >::value > * = nullptr, detail::enable_forward_value< T, U > * = nullptr> | |
constexpr | optional (U &&u) |
template<class F , detail::enable_if_ret_void< F > * = nullptr> | |
optional< T > TL_OPTIONAL_11_CONSTEXPR | or_else (F &&f) & |
Calls f if the optional is empty. More... | |
template<class F , detail::disable_if_ret_void< F > * = nullptr> | |
optional< T > 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 > 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 > 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(std::is_nothrow_move_constructible< T >::value &&detail::is_nothrow_swappable< T >::value) |
optional | take () |
Takes the value out of the optional, leaving it empty. More... | |
TL_OPTIONAL_11_CONSTEXPR T & | value () & |
Returns the contained value if there is one, otherwise throws bad_optional_access. More... | |
TL_OPTIONAL_11_CONSTEXPR T && | value () && |
const TL_OPTIONAL_11_CONSTEXPR T & | value () const & |
const TL_OPTIONAL_11_CONSTEXPR T && | value () const && |
template<class U > | |
TL_OPTIONAL_11_CONSTEXPR T | value_or (U &&u) && |
template<class U > | |
constexpr T | value_or (U &&u) const & |
Returns the stored value if there is one, otherwise returns u More... | |
~optional ()=default | |
Destroys the stored value if there is one. More... | |
Public Attributes | |
template<class F > | |
decltype(optional_map_impl(std::declval< optional & >(), std::declval< F && >())) TL_OPTIONAL_11_CONSTEXPR | map (F &&f) & |
Carries out some operation on the stored object if there is one. More... | |
template<class F > | |
decltype(optional_map_impl(std::declval< optional && >(), std::declval< F && >())) TL_OPTIONAL_11_CONSTEXPR | map (F &&f) && |
template<class F > | |
constexpr decltype(optional_map_impl(std::declval< const optional & >(), std::declval< F && >())) | map (F &&f) const & |
template<class F > | |
constexpr decltype(optional_map_impl(std::declval< const optional && >(), std::declval< F && >())) | map (F &&f) const && |
template<class F > | |
decltype(optional_map_impl(std::declval< optional & >(), std::declval< F && >())) TL_OPTIONAL_11_CONSTEXPR | transform (F &&f) & |
Carries out some operation on the stored object if there is one. More... | |
template<class F > | |
decltype(optional_map_impl(std::declval< optional && >(), std::declval< F && >())) TL_OPTIONAL_11_CONSTEXPR | transform (F &&f) && |
template<class F > | |
constexpr decltype(optional_map_impl(std::declval< const optional & >(), std::declval< F && >())) | transform (F &&f) const & |
template<class F > | |
constexpr decltype(optional_map_impl(std::declval< const optional && >(), std::declval< F && >())) | transform (F &&f) const && |
Private Types | |
using | base = detail::optional_move_assign_base< 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.
Definition at line 120 of file 3rdparty/tl/optional.hpp.
|
private |
Definition at line 682 of file 3rdparty/tl/optional.hpp.
using tl::optional< T >::value_type = T |
Definition at line 1044 of file 3rdparty/tl/optional.hpp.
|
constexprdefaultnoexcept |
Constructs an optional that does not contain a value.
|
inlineconstexprnoexcept |
Definition at line 1049 of file 3rdparty/tl/optional.hpp.
|
default |
Copy constructor
If rhs
contains a value, the stored value is direct-initialized with it. Otherwise, the constructed optional is empty.
|
default |
Move constructor
If rhs
contains a value, the stored value is direct-initialized with it. Otherwise, the constructed optional is empty.
|
inlineexplicitconstexpr |
Constructs the stored value in-place using the given arguments.
Definition at line 1065 of file 3rdparty/tl/optional.hpp.
|
inlineexplicit |
Definition at line 1071 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Constructs the stored value with u
.
Definition at line 1084 of file 3rdparty/tl/optional.hpp.
|
inlineexplicitconstexpr |
Definition at line 1090 of file 3rdparty/tl/optional.hpp.
|
inline |
Converting copy constructor.
Definition at line 1096 of file 3rdparty/tl/optional.hpp.
|
inlineexplicit |
Definition at line 1105 of file 3rdparty/tl/optional.hpp.
|
inline |
Converting move constructor.
Definition at line 1115 of file 3rdparty/tl/optional.hpp.
|
inlineexplicit |
Definition at line 1124 of file 3rdparty/tl/optional.hpp.
|
default |
Destroys the stored value if there is one.
|
inline |
Carries out some operation which returns an optional on the stored object if there is one.
Definition at line 739 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 749 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 759 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 770 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Returns u
if *this
has a value, otherwise an empty optional.
Definition at line 995 of file 3rdparty/tl/optional.hpp.
|
inline |
Returns rhs
if *this
is empty, otherwise the current value.
Definition at line 1001 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1009 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1005 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1014 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1019 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1027 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1023 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1032 of file 3rdparty/tl/optional.hpp.
Constructs the value in-place, destroying the current one if there is one.
Definition at line 1216 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1229 of file 3rdparty/tl/optional.hpp.
|
inlineconstexprnoexcept |
Returns whether or not the optional has a value.
Definition at line 1282 of file 3rdparty/tl/optional.hpp.
|
inline |
Maps the stored value with f
if there is one, otherwise returns u
.
Definition at line 943 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 948 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 953 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 959 of file 3rdparty/tl/optional.hpp.
|
inline |
Maps the stored value with f
if there is one, otherwise calls u
and returns the result.
Definition at line 968 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 974 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 980 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 987 of file 3rdparty/tl/optional.hpp.
|
inlineexplicitconstexprnoexcept |
Definition at line 1284 of file 3rdparty/tl/optional.hpp.
|
inline |
Returns the stored value.
Definition at line 1269 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1273 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1271 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1278 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1264 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Returns a pointer to the stored value.
Definition at line 1260 of file 3rdparty/tl/optional.hpp.
|
default |
Copy assignment.
Copies the value from rhs
if there is one. Otherwise resets the stored value in *this
.
|
inline |
Converting copy assignment operator.
Copies the value from rhs
if there is one. Otherwise resets the stored value in *this
.
Definition at line 1176 of file 3rdparty/tl/optional.hpp.
|
inlinenoexcept |
Assignment to empty.
Destroys the current value if there is one.
Definition at line 1136 of file 3rdparty/tl/optional.hpp.
|
default |
Move assignment.
Moves the value from rhs
if there is one. Otherwise resets the stored value in *this
.
|
inline |
Converting move assignment operator.
Moves the value from rhs
if there is one. Otherwise resets the stored value in *this
.
Definition at line 1198 of file 3rdparty/tl/optional.hpp.
|
inline |
Assigns the stored value from u
, destroying the old value if there was one.
Definition at line 1160 of file 3rdparty/tl/optional.hpp.
|
inline |
Calls f
if the optional is empty.
Definition at line 885 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 894 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 899 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 908 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 913 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 922 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 928 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 937 of file 3rdparty/tl/optional.hpp.
|
inlinenoexcept |
Destroys the stored value if one exists, making the optional empty.
Definition at line 1329 of file 3rdparty/tl/optional.hpp.
|
inlinenoexcept |
Swaps this optional with the other.
If neither optionals have a value, nothing happens. If both have a value, the values are swapped. If one has a value, it is moved to the other and the movee is left valueless.
Definition at line 1242 of file 3rdparty/tl/optional.hpp.
|
inline |
Takes the value out of the optional, leaving it empty.
Definition at line 1038 of file 3rdparty/tl/optional.hpp.
|
inline |
Returns the contained value if there is one, otherwise throws bad_optional_access.
Definition at line 1289 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1299 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1294 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1306 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1321 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Returns the stored value if there is one, otherwise returns u
Definition at line 1314 of file 3rdparty/tl/optional.hpp.
|
inline |
Carries out some operation on the stored object if there is one.
Definition at line 804 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 811 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 818 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 826 of file 3rdparty/tl/optional.hpp.
|
inline |
Carries out some operation on the stored object if there is one.
Definition at line 855 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 862 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 869 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 877 of file 3rdparty/tl/optional.hpp.