Classes | Namespaces | Macros | Typedefs | Functions | Variables
3rdparty/tl/optional.hpp File Reference
#include <exception>
#include <functional>
#include <new>
#include <type_traits>
#include <utility>
Include dependency graph for 3rdparty/tl/optional.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tl::bad_optional_access
 
struct  tl::detail::conjunction<... >
 
struct  tl::detail::conjunction< B >
 
struct  tl::detail::conjunction< B, Bs... >
 
struct  tl::nullopt_t::do_not_use
 
struct  tl::detail::optional_storage_base< T, true >::dummy
 
struct  tl::detail::optional_storage_base< T, bool >::dummy
 
struct  std::hash< tl::optional< T > >
 
struct  tl::detail::i_am_secret
 
struct  tl::in_place_t
 A tag type to tell optional to construct its value in-place. More...
 
struct  tl::detail::invoke_result_impl< F, class, Us >
 
struct  tl::detail::invoke_result_impl< F, decltype(detail::invoke(std::declval< F >(), std::declval< Us >()...), void()), Us... >
 
struct  tl::detail::swap_adl_tests::is_adl_swap_noexcept< T, U >
 
struct  tl::detail::is_nothrow_swappable< T, U >
 
struct  tl::detail::is_optional_impl< T >
 
struct  tl::detail::is_optional_impl< optional< T > >
 
struct  tl::detail::swap_adl_tests::is_std_swap_noexcept< T >
 
struct  tl::detail::swap_adl_tests::is_std_swap_noexcept< T[N]>
 
struct  tl::detail::is_swappable< T, U >
 
struct  tl::detail::is_swappable< T[N], T[N]>
 
class  tl::monostate
 Used to represent an optional with no data; essentially a bool. More...
 
struct  tl::nullopt_t
 A tag type to represent an empty optional. More...
 
class  tl::optional< T >
 
class  tl::optional< T >
 
class  tl::optional< T & >
 
struct  tl::detail::optional_copy_assign_base< T, bool >
 
struct  tl::detail::optional_copy_assign_base< T, false >
 
struct  tl::detail::optional_copy_base< T, bool >
 
struct  tl::detail::optional_copy_base< T, false >
 
struct  tl::detail::optional_delete_assign_base< T, EnableCopy, EnableMove >
 
struct  tl::detail::optional_delete_assign_base< T, false, false >
 
struct  tl::detail::optional_delete_assign_base< T, false, true >
 
struct  tl::detail::optional_delete_assign_base< T, true, false >
 
struct  tl::detail::optional_delete_ctor_base< T, EnableCopy, EnableMove >
 
struct  tl::detail::optional_delete_ctor_base< T, false, false >
 
struct  tl::detail::optional_delete_ctor_base< T, false, true >
 
struct  tl::detail::optional_delete_ctor_base< T, true, false >
 
struct  tl::detail::optional_move_assign_base< T, bool >
 
struct  tl::detail::optional_move_assign_base< T, false >
 
struct  tl::detail::optional_move_base< T, bool >
 
struct  tl::detail::optional_move_base< T, false >
 
struct  tl::detail::optional_operations_base< T >
 
struct  tl::detail::optional_storage_base< T, bool >
 
struct  tl::detail::optional_storage_base< T, true >
 
struct  tl::detail::returns_void_impl< F, class, U >
 
struct  tl::detail::returns_void_impl< F, void_t< invoke_result_t< F, U... > >, U... >
 
struct  tl::detail::swap_adl_tests::tag
 
struct  tl::detail::voider<... >
 

Namespaces

 std
 
 tl
 
 tl::detail
 \exclude
 
 tl::detail::swap_adl_tests
 

Macros

#define TL_MONOSTATE_INPLACE_MUTEX
 
#define TL_OPTIONAL_11_CONSTEXPR   constexpr
 
#define TL_OPTIONAL_IS_TRIVIALLY_COPY_ASSIGNABLE(T)   std::is_trivially_copy_assignable<T>::value
 
#define TL_OPTIONAL_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T)   std::is_trivially_copy_constructible<T>::value
 
#define TL_OPTIONAL_IS_TRIVIALLY_DESTRUCTIBLE(T)   std::is_trivially_destructible<T>::value
 
#define TL_OPTIONAL_VERSION_MAJOR   1
 
#define TL_OPTIONAL_VERSION_MINOR   0
 
#define TL_OPTIONAL_VERSION_PATCH   0
 
#define TL_TRAITS_MUTEX
 

Typedefs

template<bool B, class T , class F >
using tl::detail::conditional_t = typename std::conditional< B, T, F >::type
 
template<class T >
using tl::detail::decay_t = typename std::decay< T >::type
 
template<class T , class... U>
using tl::detail::disable_if_ret_void = enable_if_t<!returns_void< T &&, U... >::value >
 
template<class T , class U >
using tl::detail::enable_assign_forward = detail::enable_if_t< !std::is_same< optional< T >, detail::decay_t< U > >::value &&!detail::conjunction< std::is_scalar< T >, std::is_same< T, detail::decay_t< U > >>::value &&std::is_constructible< T, U >::value &&std::is_assignable< T &, U >::value >
 
template<class T , class U , class Other >
using tl::detail::enable_assign_from_other = detail::enable_if_t< std::is_constructible< T, Other >::value &&std::is_assignable< T &, Other >::value &&!std::is_constructible< T, optional< U > & >::value &&!std::is_constructible< T, optional< U > && >::value &&!std::is_constructible< T, const optional< U > & >::value &&!std::is_constructible< T, const optional< U > && >::value &&!std::is_convertible< optional< U > &, T >::value &&!std::is_convertible< optional< U > &&, T >::value &&!std::is_convertible< const optional< U > &, T >::value &&!std::is_convertible< const optional< U > &&, T >::value &&!std::is_assignable< T &, optional< U > & >::value &&!std::is_assignable< T &, optional< U > && >::value &&!std::is_assignable< T &, const optional< U > & >::value &&!std::is_assignable< T &, const optional< U > && >::value >
 
template<class T , class U >
using tl::detail::enable_forward_value = detail::enable_if_t< std::is_constructible< T, U && >::value &&!std::is_same< detail::decay_t< U >, in_place_t >::value &&!std::is_same< optional< T >, detail::decay_t< U > >::value >
 
template<class T , class U , class Other >
using tl::detail::enable_from_other = detail::enable_if_t< std::is_constructible< T, Other >::value &&!std::is_constructible< T, optional< U > & >::value &&!std::is_constructible< T, optional< U > && >::value &&!std::is_constructible< T, const optional< U > & >::value &&!std::is_constructible< T, const optional< U > && >::value &&!std::is_convertible< optional< U > &, T >::value &&!std::is_convertible< optional< U > &&, T >::value &&!std::is_convertible< const optional< U > &, T >::value &&!std::is_convertible< const optional< U > &&, T >::value >
 
template<class T , class... U>
using tl::detail::enable_if_ret_void = enable_if_t< returns_void< T &&, U... >::value >
 
template<bool E, class T = void>
using tl::detail::enable_if_t = typename std::enable_if< E, T >::type
 
template<class U >
using tl::detail::fixup_void = conditional_t< std::is_void< U >::value, monostate, U >
 
template<class F , class U , class = invoke_result_t<F, U>>
using tl::detail::get_map_return = optional< fixup_void< invoke_result_t< F, U > >>
 
template<class F , class... Us>
using tl::detail::invoke_result = invoke_result_impl< F, void, Us... >
 
template<class F , class... Us>
using tl::detail::invoke_result_t = typename invoke_result< F, Us... >::type
 
template<class T >
using tl::detail::is_optional = is_optional_impl< decay_t< T > >
 
template<class T >
using tl::detail::remove_const_t = typename std::remove_const< T >::type
 
template<class T >
using tl::detail::remove_reference_t = typename std::remove_reference< T >::type
 
template<class F , class... U>
using tl::detail::returns_void = returns_void_impl< F, void, U... >
 
template<class... Ts>
using tl::detail::void_t = typename voider< Ts... >::type
 

Functions

template<class , class >
std::false_type tl::detail::swap_adl_tests::can_swap (...) noexcept(false)
 
template<class T , class U , class = decltype(swap(std::declval<T &>(), std::declval<U &>()))>
std::true_type tl::detail::swap_adl_tests::can_swap (int) noexcept(noexcept(swap(std::declval< T & >(), std::declval< U & >())))
 
template<typename Fn , typename... Args, typename = enable_if_t<!std::is_member_pointer<decay_t<Fn>>::value>>
constexpr auto tl::detail::invoke (Fn &&f, Args &&... args) noexcept(noexcept(std::forward< Fn >(f)(std::forward< Args >(args)...))) -> decltype(std::forward< Fn >(f)(std::forward< Args >(args)...))
 
template<typename Fn , typename... Args, typename = enable_if_t<std::is_member_pointer<decay_t<Fn>>::value>, int = 0>
constexpr auto tl::detail::invoke (Fn &&f, Args &&... args) noexcept(noexcept(std::mem_fn(f)(std::forward< Args >(args)...))) -> decltype(std::mem_fn(f)(std::forward< Args >(args)...))
 
template<class T , class... Args>
constexpr optional< T > tl::make_optional (Args &&... args)
 
template<class T , class U , class... Args>
constexpr optional< T > tl::make_optional (std::initializer_list< U > il, Args &&... args)
 
template<class T = detail::i_am_secret, class U , class Ret = detail::conditional_t<std::is_same<T, detail::i_am_secret>::value, detail::decay_t<U>, T>>
constexpr optional< Ret > tl::make_optional (U &&v)
 
template<class T , class U >
constexpr bool tl::operator!= (const optional< T > &lhs, const optional< U > &rhs)
 
template<class T , class U >
constexpr bool tl::operator!= (const optional< T > &lhs, const U &rhs)
 
template<class T >
constexpr bool tl::operator!= (const optional< T > &lhs, nullopt_t) noexcept
 
template<class T , class U >
constexpr bool tl::operator!= (const U &lhs, const optional< T > &rhs)
 
template<class T >
constexpr bool tl::operator!= (nullopt_t, const optional< T > &rhs) noexcept
 
template<class T >
constexpr bool tl::operator< (const optional< T > &, nullopt_t) noexcept
 
template<class T , class U >
constexpr bool tl::operator< (const optional< T > &lhs, const optional< U > &rhs)
 
template<class T , class U >
constexpr bool tl::operator< (const optional< T > &lhs, const U &rhs)
 
template<class T , class U >
constexpr bool tl::operator< (const U &lhs, const optional< T > &rhs)
 
template<class T >
constexpr bool tl::operator< (nullopt_t, const optional< T > &rhs) noexcept
 
template<class T , class U >
constexpr bool tl::operator<= (const optional< T > &lhs, const optional< U > &rhs)
 
template<class T , class U >
constexpr bool tl::operator<= (const optional< T > &lhs, const U &rhs)
 
template<class T >
constexpr bool tl::operator<= (const optional< T > &lhs, nullopt_t) noexcept
 
template<class T , class U >
constexpr bool tl::operator<= (const U &lhs, const optional< T > &rhs)
 
template<class T >
constexpr bool tl::operator<= (nullopt_t, const optional< T > &) noexcept
 
template<class T , class U >
constexpr bool tl::operator== (const optional< T > &lhs, const optional< U > &rhs)
 Compares two optional objects. More...
 
template<class T , class U >
constexpr bool tl::operator== (const optional< T > &lhs, const U &rhs)
 Compares the optional with a value. More...
 
template<class T >
constexpr bool tl::operator== (const optional< T > &lhs, nullopt_t) noexcept
 Compares an optional to a nullopt More...
 
template<class T , class U >
constexpr bool tl::operator== (const U &lhs, const optional< T > &rhs)
 
template<class T >
constexpr bool tl::operator== (nullopt_t, const optional< T > &rhs) noexcept
 
template<class T , class U >
constexpr bool tl::operator> (const optional< T > &lhs, const optional< U > &rhs)
 
template<class T , class U >
constexpr bool tl::operator> (const optional< T > &lhs, const U &rhs)
 
template<class T >
constexpr bool tl::operator> (const optional< T > &lhs, nullopt_t) noexcept
 
template<class T , class U >
constexpr bool tl::operator> (const U &lhs, const optional< T > &rhs)
 
template<class T >
constexpr bool tl::operator> (nullopt_t, const optional< T > &) noexcept
 
template<class T >
constexpr bool tl::operator>= (const optional< T > &, nullopt_t) noexcept
 
template<class T , class U >
constexpr bool tl::operator>= (const optional< T > &lhs, const optional< U > &rhs)
 
template<class T , class U >
constexpr bool tl::operator>= (const optional< T > &lhs, const U &rhs)
 
template<class T , class U >
constexpr bool tl::operator>= (const U &lhs, const optional< T > &rhs)
 
template<class T >
constexpr bool tl::operator>= (nullopt_t, const optional< T > &rhs) noexcept
 
template<class Opt , class F , class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Opt>())), detail::enable_if_t< std::is_void< Ret >::value > * = nullptr>
auto tl::detail::optional_map_impl (Opt &&opt, F &&f) -> optional< monostate >
 
template<class Opt , class F , class Ret = decltype(detail::invoke(std::declval<F>(), *std::declval<Opt>())), detail::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
constexpr auto tl::detail::optional_map_impl (Opt &&opt, F &&f) -> optional< Ret >
 
template<class T , detail::enable_if_t< std::is_move_constructible< T >::value > * = nullptr, detail::enable_if_t< detail::is_swappable< T >::value > * = nullptr>
void tl::swap (optional< T > &lhs, optional< T > &rhs) noexcept(noexcept(lhs.swap(rhs)))
 
template<class T >
tag tl::detail::swap_adl_tests::swap (T &, T &)
 
template<class T , std::size_t N>
tag tl::detail::swap_adl_tests::swap (T(&a)[N], T(&b)[N])
 
template<class , class >
std::false_type tl::detail::swap_adl_tests::uses_std (...)
 

Variables

static constexpr in_place_t tl::in_place {}
 A tag to tell optional to construct its value in-place. More...
 
static constexpr nullopt_t tl::nullopt
 Represents an empty optional. More...
 
template<class T , class U >
std::is_same< decltype(swap(std::declval< T & >), std::declval< U & >))), tag > tl::detail::swap_adl_tests::uses_std (int)
 

Macro Definition Documentation

◆ TL_MONOSTATE_INPLACE_MUTEX

#define TL_MONOSTATE_INPLACE_MUTEX

Definition at line 108 of file 3rdparty/tl/optional.hpp.

◆ TL_OPTIONAL_11_CONSTEXPR

#define TL_OPTIONAL_11_CONSTEXPR   constexpr

Definition at line 103 of file 3rdparty/tl/optional.hpp.

◆ TL_OPTIONAL_IS_TRIVIALLY_COPY_ASSIGNABLE

#define TL_OPTIONAL_IS_TRIVIALLY_COPY_ASSIGNABLE (   T)    std::is_trivially_copy_assignable<T>::value

Definition at line 89 of file 3rdparty/tl/optional.hpp.

◆ TL_OPTIONAL_IS_TRIVIALLY_COPY_CONSTRUCTIBLE

#define TL_OPTIONAL_IS_TRIVIALLY_COPY_CONSTRUCTIBLE (   T)    std::is_trivially_copy_constructible<T>::value

Definition at line 87 of file 3rdparty/tl/optional.hpp.

◆ TL_OPTIONAL_IS_TRIVIALLY_DESTRUCTIBLE

#define TL_OPTIONAL_IS_TRIVIALLY_DESTRUCTIBLE (   T)    std::is_trivially_destructible<T>::value

Definition at line 91 of file 3rdparty/tl/optional.hpp.

◆ TL_OPTIONAL_VERSION_MAJOR

#define TL_OPTIONAL_VERSION_MAJOR   1

Definition at line 20 of file 3rdparty/tl/optional.hpp.

◆ TL_OPTIONAL_VERSION_MINOR

#define TL_OPTIONAL_VERSION_MINOR   0

Definition at line 21 of file 3rdparty/tl/optional.hpp.

◆ TL_OPTIONAL_VERSION_PATCH

#define TL_OPTIONAL_VERSION_PATCH   0

Definition at line 22 of file 3rdparty/tl/optional.hpp.

◆ TL_TRAITS_MUTEX

#define TL_TRAITS_MUTEX

Definition at line 124 of file 3rdparty/tl/optional.hpp.



depthai
Author(s): Martin Peterlin
autogenerated on Sat Mar 22 2025 02:58:19