#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 U = T, detail::enable_if_t<!detail::is_optional< detail::decay_t< U >>::value > * = nullptr> | |
optional & | emplace (U &&u) noexcept |
Rebinds this optional to u . More... | |
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) && |
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 |
constexpr const T & | operator* () const noexcept |
TL_OPTIONAL_11_CONSTEXPR T & | operator* () noexcept |
Returns the stored value. More... | |
constexpr const T * | operator-> () const noexcept |
Returns a pointer to the stored value. More... | |
TL_OPTIONAL_11_CONSTEXPR T * | operator-> () noexcept |
optional & | operator= (const optional &rhs)=default |
template<class U > | |
optional & | operator= (const optional< U > &rhs) noexcept |
optional & | operator= (nullopt_t) noexcept |
template<class U = T, detail::enable_if_t<!detail::is_optional< detail::decay_t< U >>::value > * = nullptr> | |
optional & | operator= (U &&u) |
Rebinds this optional to u . More... | |
constexpr | optional () noexcept |
Constructs an optional that does not contain a value. More... | |
TL_OPTIONAL_11_CONSTEXPR | optional (const optional &rhs) noexcept=default |
template<class U > | |
constexpr | optional (const optional< U > &rhs) noexcept |
constexpr | optional (nullopt_t) noexcept |
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) noexcept |
Constructs the stored value with u . More... | |
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 |
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... | |
const TL_OPTIONAL_11_CONSTEXPR T & | value () const |
template<class U > | |
TL_OPTIONAL_11_CONSTEXPR T | value_or (U &&u) &&noexcept |
\group value_or More... | |
template<class U > | |
constexpr T | value_or (U &&u) const &noexcept |
Returns the stored value if there is one, otherwise returns u More... | |
~optional ()=default | |
No-op. More... | |
Public Attributes | |
template<class F > | |
decltype(detail::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(detail::optional_map_impl(std::declval< optional && >(), std::declval< F && >())) TL_OPTIONAL_11_CONSTEXPR | map (F &&f) && |
template<class F > | |
constexpr decltype(detail::optional_map_impl(std::declval< const optional & >(), std::declval< F && >())) | map (F &&f) const & |
template<class F > | |
constexpr decltype(detail::optional_map_impl(std::declval< const optional && >(), std::declval< F && >())) | map (F &&f) const && |
template<class F > | |
decltype(detail::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(detail::optional_map_impl(std::declval< optional && >(), std::declval< F && >())) TL_OPTIONAL_11_CONSTEXPR | transform (F &&f) && |
template<class F > | |
constexpr decltype(detail::optional_map_impl(std::declval< const optional & >(), std::declval< F && >())) | transform (F &&f) const & |
template<class F > | |
constexpr decltype(detail::optional_map_impl(std::declval< const optional && >(), std::declval< F && >())) | transform (F &&f) const && |
Private Attributes | |
T * | m_value |
Specialization for when T
is a reference. optional<T&>
acts similarly to a T*
, but provides more operations and shows intent more clearly.
Definition at line 1560 of file 3rdparty/tl/optional.hpp.
using tl::optional< T & >::value_type = T & |
Definition at line 1919 of file 3rdparty/tl/optional.hpp.
|
inlineconstexprnoexcept |
Constructs an optional that does not contain a value.
Definition at line 1922 of file 3rdparty/tl/optional.hpp.
|
inlineconstexprnoexcept |
Definition at line 1924 of file 3rdparty/tl/optional.hpp.
|
defaultnoexcept |
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.
|
inlineconstexprnoexcept |
Constructs the stored value with u
.
Definition at line 1942 of file 3rdparty/tl/optional.hpp.
|
inlineexplicitconstexprnoexcept |
Definition at line 1947 of file 3rdparty/tl/optional.hpp.
|
default |
No-op.
|
inline |
Carries out some operation which returns an optional on the stored object if there is one.
Definition at line 1612 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1622 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1632 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1643 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Returns u
if *this
has a value, otherwise an empty optional.
Definition at line 1870 of file 3rdparty/tl/optional.hpp.
|
inline |
Returns rhs
if *this
is empty, otherwise the current value.
Definition at line 1876 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1884 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1880 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1889 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1894 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1902 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1898 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1907 of file 3rdparty/tl/optional.hpp.
|
inlinenoexcept |
Rebinds this optional to u
.
Definition at line 1989 of file 3rdparty/tl/optional.hpp.
|
inlineconstexprnoexcept |
Definition at line 2005 of file 3rdparty/tl/optional.hpp.
|
inline |
Maps the stored value with f
if there is one, otherwise returns u
Definition at line 1818 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1823 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1828 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1834 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 1843 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1849 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1855 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1862 of file 3rdparty/tl/optional.hpp.
|
inlineexplicitconstexprnoexcept |
Definition at line 2007 of file 3rdparty/tl/optional.hpp.
|
inlineconstexprnoexcept |
Definition at line 2003 of file 3rdparty/tl/optional.hpp.
|
inlinenoexcept |
Returns the stored value.
Definition at line 2001 of file 3rdparty/tl/optional.hpp.
|
inlineconstexprnoexcept |
Returns a pointer to the stored value.
Definition at line 1996 of file 3rdparty/tl/optional.hpp.
|
inlinenoexcept |
Definition at line 1998 of file 3rdparty/tl/optional.hpp.
|
default |
Copy assignment.
Rebinds this optional to the referee of rhs
if there is one. Otherwise resets the stored value in *this
.
|
inlinenoexcept |
Converting copy assignment operator.
Rebinds this optional to the referee of rhs
if there is one. Otherwise resets the stored value in *this
.
Definition at line 1980 of file 3rdparty/tl/optional.hpp.
|
inlinenoexcept |
Assignment to empty.
Destroys the current value if there is one.
Definition at line 1955 of file 3rdparty/tl/optional.hpp.
|
inline |
Rebinds this optional to u
.
Definition at line 1970 of file 3rdparty/tl/optional.hpp.
|
inline |
Calls f
if the optional is empty.
Definition at line 1760 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1769 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1774 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1783 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1788 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1797 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1803 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1812 of file 3rdparty/tl/optional.hpp.
|
inlinenoexcept |
Destroys the stored value if one exists, making the optional empty.
Definition at line 2040 of file 3rdparty/tl/optional.hpp.
|
inlinenoexcept |
Definition at line 1993 of file 3rdparty/tl/optional.hpp.
|
inline |
Takes the value out of the optional, leaving it empty.
Definition at line 1913 of file 3rdparty/tl/optional.hpp.
|
inline |
Returns the contained value if there is one, otherwise throws bad_optional_access.
Definition at line 2012 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 2017 of file 3rdparty/tl/optional.hpp.
|
inlinenoexcept |
\group value_or
Definition at line 2032 of file 3rdparty/tl/optional.hpp.
|
inlineconstexprnoexcept |
Returns the stored value if there is one, otherwise returns u
Definition at line 2024 of file 3rdparty/tl/optional.hpp.
|
private |
Definition at line 2043 of file 3rdparty/tl/optional.hpp.
|
inline |
Carries out some operation on the stored object if there is one.
Definition at line 1677 of file 3rdparty/tl/optional.hpp.
|
inline |
Definition at line 1684 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1691 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1699 of file 3rdparty/tl/optional.hpp.
|
inline |
Carries out some operation on the stored object if there is one.
Definition at line 1728 of file 3rdparty/tl/optional.hpp.
|
inline |
\group map \synopsis template <class F> auto transform(F &&f) &&;
Definition at line 1737 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1744 of file 3rdparty/tl/optional.hpp.
|
inlineconstexpr |
Definition at line 1752 of file 3rdparty/tl/optional.hpp.