WPILibC++ 2025.1.1
Loading...
Searching...
No Matches
wpi::detail_expected Namespace Reference

Namespaces

namespace  swap_adl_tests
 

Classes

struct  conjunction
 
struct  conjunction< B >
 
struct  conjunction< B, Bs... >
 
struct  default_constructor_tag
 
struct  expected_copy_assign_base
 
struct  expected_copy_assign_base< T, E, false >
 
struct  expected_copy_base
 
struct  expected_copy_base< T, E, false >
 
struct  expected_default_ctor_base
 
struct  expected_default_ctor_base< T, E, false >
 
struct  expected_delete_assign_base
 
struct  expected_delete_assign_base< T, E, false, false >
 
struct  expected_delete_assign_base< T, E, false, true >
 
struct  expected_delete_assign_base< T, E, true, false >
 
struct  expected_delete_ctor_base
 
struct  expected_delete_ctor_base< T, E, false, false >
 
struct  expected_delete_ctor_base< T, E, false, true >
 
struct  expected_delete_ctor_base< T, E, true, false >
 
struct  expected_move_assign_base
 
struct  expected_move_assign_base< T, E, false >
 
struct  expected_move_base
 
struct  expected_move_base< T, E, false >
 
struct  expected_operations_base
 
struct  expected_operations_base< void, E >
 
struct  expected_storage_base
 
struct  expected_storage_base< T, E, false, true >
 
struct  expected_storage_base< T, E, true, false >
 
struct  expected_storage_base< T, E, true, true >
 
struct  expected_storage_base< void, E, false, false >
 
struct  expected_storage_base< void, E, false, true >
 
struct  invoke_result_impl
 
struct  invoke_result_impl< F, decltype(detail_expected::invoke(std::declval< F >(), std::declval< Us >()...), void()), Us... >
 
struct  is_expected_impl
 
struct  is_expected_impl< expected< T, E > >
 
struct  is_nothrow_swappable
 
struct  is_swappable
 
struct  is_swappable< T[N], T[N]>
 
struct  no_init_t
 
struct  TC
 

Typedefs

template<class T >
using remove_const_t = typename std::remove_const<T>::type
 
template<class T >
using remove_reference_t = typename std::remove_reference<T>::type
 
template<class T >
using decay_t = typename std::decay<T>::type
 
template<bool E, class T = void>
using enable_if_t = typename std::enable_if<E, T>::type
 
template<bool B, class T , class F >
using conditional_t = typename std::conditional<B, T, F>::type
 
template<class F , class... Us>
using invoke_result = invoke_result_impl<F, void, Us...>
 
template<class F , class... Us>
using invoke_result_t = typename invoke_result<F, Us...>::type
 
template<class T >
using is_expected = is_expected_impl<decay_t<T>>
 
template<class T , class E , class U >
using expected_enable_forward_value
 
template<class T , class E , class U , class G , class UR , class GR >
using expected_enable_from_other
 
template<class T , class U >
using is_void_or = conditional_t<std::is_void<T>::value, std::true_type, U>
 
template<class T >
using is_copy_constructible_or_void
 
template<class T >
using is_move_constructible_or_void
 
template<class T >
using is_copy_assignable_or_void = is_void_or<T, std::is_copy_assignable<T>>
 
template<class T >
using is_move_assignable_or_void = is_void_or<T, std::is_move_assignable<T>>
 
template<class Exp >
using exp_t = typename detail_expected::decay_t<Exp>::value_type
 
template<class Exp >
using err_t = typename detail_expected::decay_t<Exp>::error_type
 
template<class Exp , class Ret >
using ret_t = expected<Ret, err_t<Exp>>
 

Functions

template<typename E >
WPI_EXPECTED_11_CONSTEXPR void throw_exception (E &&e)
 
template<typename Fn , typename... Args, typename = enable_if_t<std::is_member_pointer<decay_t<Fn>>::value>, int = 0>
constexpr auto 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<typename Fn , typename... Args, typename = enable_if_t<!std::is_member_pointer<decay_t<Fn>>::value>>
constexpr auto 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<class Exp , class F , class Ret = decltype(detail_expected::invoke(std::declval<F>(), *std::declval<Exp>())), detail_expected::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr>
auto and_then_impl (Exp &&exp, F &&f) -> Ret
 
template<class Exp , class F , class Ret = decltype(detail_expected::invoke(std::declval<F>())), detail_expected::enable_if_t< std::is_void< exp_t< Exp > >::value > * = nullptr>
constexpr auto and_then_impl (Exp &&exp, F &&f) -> Ret
 
template<class Exp , class F , detail_expected::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail_expected::invoke(std::declval<F>(), *std::declval<Exp>())), detail_expected::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
constexpr auto expected_map_impl (Exp &&exp, F &&f) -> ret_t< Exp, detail_expected::decay_t< Ret > >
 
template<class Exp , class F , detail_expected::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail_expected::invoke(std::declval<F>(), *std::declval<Exp>())), detail_expected::enable_if_t< std::is_void< Ret >::value > * = nullptr>
auto expected_map_impl (Exp &&exp, F &&f) -> expected< void, err_t< Exp > >
 
template<class Exp , class F , detail_expected::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail_expected::invoke(std::declval<F>(), std::declval<Exp>().error())), detail_expected::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
constexpr auto map_error_impl (Exp &&exp, F &&f) -> expected< exp_t< Exp >, detail_expected::decay_t< Ret > >
 
template<class Exp , class F , detail_expected::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail_expected::invoke(std::declval<F>(), std::declval<Exp>().error())), detail_expected::enable_if_t< std::is_void< Ret >::value > * = nullptr>
auto map_error_impl (Exp &&exp, F &&f) -> expected< exp_t< Exp >, monostate >
 
template<class Exp , class F , class Ret = decltype(detail_expected::invoke(std::declval<F>(), std::declval<Exp>().error())), detail_expected::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
auto or_else_impl (Exp &&exp, F &&f) -> Ret
 
template<class Exp , class F , class Ret = decltype(detail_expected::invoke(std::declval<F>(), std::declval<Exp>().error())), detail_expected::enable_if_t< std::is_void< Ret >::value > * = nullptr>
detail_expected::decay_t< Exp > or_else_impl (Exp &&exp, F &&f)
 

Variables

static constexpr no_init_t no_init {}
 

Typedef Documentation

◆ conditional_t

template<bool B, class T , class F >
using wpi::detail_expected::conditional_t = typename std::conditional<B, T, F>::type

◆ decay_t

template<class T >
using wpi::detail_expected::decay_t = typename std::decay<T>::type

◆ enable_if_t

template<bool E, class T = void>
using wpi::detail_expected::enable_if_t = typename std::enable_if<E, T>::type

◆ err_t

template<class Exp >
using wpi::detail_expected::err_t = typename detail_expected::decay_t<Exp>::error_type

◆ exp_t

template<class Exp >
using wpi::detail_expected::exp_t = typename detail_expected::decay_t<Exp>::value_type

◆ expected_enable_forward_value

template<class T , class E , class U >
using wpi::detail_expected::expected_enable_forward_value
Initial value:
detail_expected::enable_if_t<
std::is_constructible<T, U &&>::value &&
!std::is_same<detail_expected::decay_t<U>, in_place_t>::value &&
!std::is_same<expected<T, E>, detail_expected::decay_t<U>>::value &&
!std::is_same<unexpected<E>, detail_expected::decay_t<U>>::value>

◆ expected_enable_from_other

template<class T , class E , class U , class G , class UR , class GR >
using wpi::detail_expected::expected_enable_from_other
Initial value:
detail_expected::enable_if_t<
std::is_constructible<T, UR>::value &&
std::is_constructible<E, GR>::value &&
!std::is_constructible<T, expected<U, G> &>::value &&
!std::is_constructible<T, expected<U, G> &&>::value &&
!std::is_constructible<T, const expected<U, G> &>::value &&
!std::is_constructible<T, const expected<U, G> &&>::value &&
!std::is_convertible<expected<U, G> &, T>::value &&
!std::is_convertible<expected<U, G> &&, T>::value &&
!std::is_convertible<const expected<U, G> &, T>::value &&
!std::is_convertible<const expected<U, G> &&, T>::value>

◆ invoke_result

template<class F , class... Us>
using wpi::detail_expected::invoke_result = invoke_result_impl<F, void, Us...>

◆ invoke_result_t

template<class F , class... Us>
using wpi::detail_expected::invoke_result_t = typename invoke_result<F, Us...>::type

◆ is_copy_assignable_or_void

template<class T >
using wpi::detail_expected::is_copy_assignable_or_void = is_void_or<T, std::is_copy_assignable<T>>

◆ is_copy_constructible_or_void

Initial value:
is_void_or<T, std::is_copy_constructible<T>>

◆ is_expected

◆ is_move_assignable_or_void

template<class T >
using wpi::detail_expected::is_move_assignable_or_void = is_void_or<T, std::is_move_assignable<T>>

◆ is_move_constructible_or_void

Initial value:
is_void_or<T, std::is_move_constructible<T>>

◆ is_void_or

template<class T , class U >
using wpi::detail_expected::is_void_or = conditional_t<std::is_void<T>::value, std::true_type, U>

◆ remove_const_t

template<class T >
using wpi::detail_expected::remove_const_t = typename std::remove_const<T>::type

◆ remove_reference_t

template<class T >
using wpi::detail_expected::remove_reference_t = typename std::remove_reference<T>::type

◆ ret_t

template<class Exp , class Ret >
using wpi::detail_expected::ret_t = expected<Ret, err_t<Exp>>

Function Documentation

◆ and_then_impl() [1/2]

template<class Exp , class F , class Ret = decltype(detail_expected::invoke(std::declval<F>(), *std::declval<Exp>())), detail_expected::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr>
auto wpi::detail_expected::and_then_impl ( Exp && exp,
F && f ) -> Ret

◆ and_then_impl() [2/2]

template<class Exp , class F , class Ret = decltype(detail_expected::invoke(std::declval<F>())), detail_expected::enable_if_t< std::is_void< exp_t< Exp > >::value > * = nullptr>
auto wpi::detail_expected::and_then_impl ( Exp && exp,
F && f ) -> Ret
constexpr

◆ expected_map_impl() [1/2]

template<class Exp , class F , detail_expected::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail_expected::invoke(std::declval<F>(), *std::declval<Exp>())), detail_expected::enable_if_t< std::is_void< Ret >::value > * = nullptr>
auto wpi::detail_expected::expected_map_impl ( Exp && exp,
F && f ) -> expected<void, err_t<Exp>>

◆ expected_map_impl() [2/2]

template<class Exp , class F , detail_expected::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail_expected::invoke(std::declval<F>(), *std::declval<Exp>())), detail_expected::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
auto wpi::detail_expected::expected_map_impl ( Exp && exp,
F && f ) -> ret_t<Exp, detail_expected::decay_t<Ret>>
constexpr

◆ invoke() [1/2]

template<typename Fn , typename... Args, typename = enable_if_t<!std::is_member_pointer<decay_t<Fn>>::value>>
auto wpi::detail_expected::invoke ( Fn && f,
Args &&... args ) -> decltype(std::forward<Fn>(f)(std::forward<Args>(args)...))
constexprnoexcept

◆ invoke() [2/2]

template<typename Fn , typename... Args, typename = enable_if_t<std::is_member_pointer<decay_t<Fn>>::value>, int = 0>
auto wpi::detail_expected::invoke ( Fn && f,
Args &&... args ) -> decltype(std::mem_fn(f)(std::forward<Args>(args)...))
constexprnoexcept

◆ map_error_impl() [1/2]

template<class Exp , class F , detail_expected::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail_expected::invoke(std::declval<F>(), std::declval<Exp>().error())), detail_expected::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
auto wpi::detail_expected::map_error_impl ( Exp && exp,
F && f ) -> expected<exp_t<Exp>, detail_expected::decay_t<Ret>>
constexpr

◆ map_error_impl() [2/2]

template<class Exp , class F , detail_expected::enable_if_t<!std::is_void< exp_t< Exp > >::value > * = nullptr, class Ret = decltype(detail_expected::invoke(std::declval<F>(), std::declval<Exp>().error())), detail_expected::enable_if_t< std::is_void< Ret >::value > * = nullptr>
auto wpi::detail_expected::map_error_impl ( Exp && exp,
F && f ) -> expected<exp_t<Exp>, monostate>

◆ or_else_impl() [1/2]

template<class Exp , class F , class Ret = decltype(detail_expected::invoke(std::declval<F>(), std::declval<Exp>().error())), detail_expected::enable_if_t< std::is_void< Ret >::value > * = nullptr>
detail_expected::decay_t< Exp > wpi::detail_expected::or_else_impl ( Exp && exp,
F && f )

◆ or_else_impl() [2/2]

template<class Exp , class F , class Ret = decltype(detail_expected::invoke(std::declval<F>(), std::declval<Exp>().error())), detail_expected::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
auto wpi::detail_expected::or_else_impl ( Exp && exp,
F && f ) -> Ret

◆ throw_exception()

template<typename E >
WPI_EXPECTED_11_CONSTEXPR void wpi::detail_expected::throw_exception ( E && e)

Variable Documentation

◆ no_init

no_init_t wpi::detail_expected::no_init {}
staticconstexpr