WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
expected File Reference
#include <exception>
#include <functional>
#include <type_traits>
#include <utility>

Go to the source code of this file.

Classes

class  wpi::util::monostate
struct  wpi::util::in_place_t
class  wpi::util::unexpected< E >
struct  wpi::util::unexpect_t
struct  wpi::util::detail_expected::conjunction<... >
struct  wpi::util::detail_expected::conjunction< B >
struct  wpi::util::detail_expected::conjunction< B, Bs... >
struct  wpi::util::detail_expected::invoke_result_impl< F, decltype(detail_expected::invoke(std::declval< F >(), std::declval< Us >()...), void()), Us... >
struct  wpi::util::detail_expected::swap_adl_tests::tag
struct  wpi::util::detail_expected::swap_adl_tests::is_std_swap_noexcept< T >
struct  wpi::util::detail_expected::swap_adl_tests::is_std_swap_noexcept< T[N]>
struct  wpi::util::detail_expected::swap_adl_tests::is_adl_swap_noexcept< T, U >
struct  wpi::util::detail_expected::is_swappable< T, U >
struct  wpi::util::detail_expected::is_swappable< T[N], T[N]>
struct  wpi::util::detail_expected::is_nothrow_swappable< T, U >
struct  wpi::util::detail_expected::is_expected_impl< T >
struct  wpi::util::detail_expected::is_expected_impl< expected< T, E > >
struct  wpi::util::detail_expected::no_init_t
struct  wpi::util::detail_expected::expected_storage_base< T, E, bool, bool >
struct  wpi::util::detail_expected::expected_storage_base< T, E, true, true >
struct  wpi::util::detail_expected::expected_storage_base< T, E, true, false >
struct  wpi::util::detail_expected::expected_storage_base< T, E, false, true >
struct  wpi::util::detail_expected::expected_storage_base< void, E, false, true >
struct  wpi::util::detail_expected::expected_storage_base< void, E, false, true >::dummy
struct  wpi::util::detail_expected::expected_storage_base< void, E, false, false >
struct  wpi::util::detail_expected::expected_operations_base< T, E >
struct  wpi::util::detail_expected::expected_operations_base< void, E >
struct  wpi::util::detail_expected::expected_copy_base< T, E, bool >
struct  wpi::util::detail_expected::expected_copy_base< T, E, false >
struct  wpi::util::detail_expected::expected_move_base< T, E, bool >
struct  wpi::util::detail_expected::expected_move_base< T, E, false >
struct  wpi::util::detail_expected::expected_copy_assign_base< T, E, bool >
struct  wpi::util::detail_expected::expected_copy_assign_base< T, E, false >
struct  wpi::util::detail_expected::expected_move_assign_base< T, E, bool >
struct  wpi::util::detail_expected::expected_move_assign_base< T, E, false >
struct  wpi::util::detail_expected::expected_delete_ctor_base< T, E, EnableCopy, EnableMove >
struct  wpi::util::detail_expected::expected_delete_ctor_base< T, E, true, false >
struct  wpi::util::detail_expected::expected_delete_ctor_base< T, E, false, true >
struct  wpi::util::detail_expected::expected_delete_ctor_base< T, E, false, false >
struct  wpi::util::detail_expected::expected_delete_assign_base< T, E, EnableCopy, EnableMove >
struct  wpi::util::detail_expected::expected_delete_assign_base< T, E, true, false >
struct  wpi::util::detail_expected::expected_delete_assign_base< T, E, false, true >
struct  wpi::util::detail_expected::expected_delete_assign_base< T, E, false, false >
struct  wpi::util::detail_expected::default_constructor_tag
struct  wpi::util::detail_expected::expected_default_ctor_base< T, E, Enable >
struct  wpi::util::detail_expected::expected_default_ctor_base< T, E, false >
class  wpi::util::bad_expected_access< E >
class  wpi::util::expected< T, E >
 An expected<T, E> object is an object that contains the storage for another object and manages the lifetime of this contained object T. More...

Namespaces

namespace  wpi
namespace  wpi::util
namespace  wpi::util::detail_expected
namespace  wpi::util::detail_expected::swap_adl_tests

Macros

#define WPI_EXPECTED_VERSION_MAJOR   1
#define WPI_EXPECTED_VERSION_MINOR   1
#define WPI_EXPECTED_VERSION_PATCH   0
#define WPI_EXPECTED_MSVC2015_CONSTEXPR   constexpr
#define WPI_ASSERT(x)
#define WPI_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE(T)
#define WPI_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE(T)
#define WPI_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE(T)
#define WPI_EXPECTED_GCC49_CONSTEXPR   constexpr
#define WPI_EXPECTED_11_CONSTEXPR   constexpr
#define WPI_MONOSTATE_INPLACE_MUTEX
#define WPI_TRAITS_MUTEX

Typedefs

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

Functions

template<class E>
constexpr bool wpi::util::operator== (const unexpected< E > &lhs, const unexpected< E > &rhs)
template<class E>
constexpr bool wpi::util::operator!= (const unexpected< E > &lhs, const unexpected< E > &rhs)
template<class E>
constexpr bool wpi::util::operator< (const unexpected< E > &lhs, const unexpected< E > &rhs)
template<class E>
constexpr bool wpi::util::operator<= (const unexpected< E > &lhs, const unexpected< E > &rhs)
template<class E>
constexpr bool wpi::util::operator> (const unexpected< E > &lhs, const unexpected< E > &rhs)
template<class E>
constexpr bool wpi::util::operator>= (const unexpected< E > &lhs, const unexpected< E > &rhs)
template<class E>
unexpected< typename std::decay< E >::type > wpi::util::make_unexpected (E &&e)
template<typename E>
WPI_EXPECTED_11_CONSTEXPR void wpi::util::detail_expected::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 wpi::util::detail_expected::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 wpi::util::detail_expected::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 T>
tag wpi::util::detail_expected::swap_adl_tests::swap (T &, T &)
template<class T, std::size_t N>
tag wpi::util::detail_expected::swap_adl_tests::swap (T(&a)[N], T(&b)[N])
template<class, class>
std::false_type wpi::util::detail_expected::swap_adl_tests::can_swap (...) noexcept(false)
template<class T, class U, class = decltype(swap(std::declval<T &>(), std::declval<U &>()))>
std::true_type wpi::util::detail_expected::swap_adl_tests::can_swap (int) noexcept(noexcept(swap(std::declval< T & >(), std::declval< U & >())))
template<class, class>
std::false_type wpi::util::detail_expected::swap_adl_tests::uses_std (...)
template<class T, class U>
std::is_same< decltype(swap(std::declval< T & >(), std::declval< U & >())), tagwpi::util::detail_expected::swap_adl_tests::uses_std (int)
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::util::detail_expected::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 wpi::util::detail_expected::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 wpi::util::detail_expected::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 wpi::util::detail_expected::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>())), detail_expected::enable_if_t<!std::is_void< Ret >::value > * = nullptr>
constexpr auto wpi::util::detail_expected::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>())), detail_expected::enable_if_t< std::is_void< Ret >::value > * = nullptr>
auto wpi::util::detail_expected::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 wpi::util::detail_expected::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 wpi::util::detail_expected::map_error_impl (Exp &&exp, F &&f) -> expected< exp_t< Exp >, monostate >
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 wpi::util::detail_expected::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 wpi::util::detail_expected::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 wpi::util::detail_expected::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 > wpi::util::detail_expected::or_else_impl (Exp &&exp, F &&f)
template<class T, class E, class U, class F>
constexpr bool wpi::util::operator== (const expected< T, E > &lhs, const expected< U, F > &rhs)
template<class T, class E, class U, class F>
constexpr bool wpi::util::operator!= (const expected< T, E > &lhs, const expected< U, F > &rhs)
template<class E, class F>
constexpr bool wpi::util::operator== (const expected< void, E > &lhs, const expected< void, F > &rhs)
template<class E, class F>
constexpr bool wpi::util::operator!= (const expected< void, E > &lhs, const expected< void, F > &rhs)
template<class T, class E, class U>
constexpr bool wpi::util::operator== (const expected< T, E > &x, const U &v)
template<class T, class E, class U>
constexpr bool wpi::util::operator== (const U &v, const expected< T, E > &x)
template<class T, class E, class U>
constexpr bool wpi::util::operator!= (const expected< T, E > &x, const U &v)
template<class T, class E, class U>
constexpr bool wpi::util::operator!= (const U &v, const expected< T, E > &x)
template<class T, class E>
constexpr bool wpi::util::operator== (const expected< T, E > &x, const unexpected< E > &e)
template<class T, class E>
constexpr bool wpi::util::operator== (const unexpected< E > &e, const expected< T, E > &x)
template<class T, class E>
constexpr bool wpi::util::operator!= (const expected< T, E > &x, const unexpected< E > &e)
template<class T, class E>
constexpr bool wpi::util::operator!= (const unexpected< E > &e, const expected< T, E > &x)
template<class T, class E, detail_expected::enable_if_t<(std::is_void< T >::value||std::is_move_constructible< T >::value) &&detail_expected::is_swappable< T >::value &&std::is_move_constructible< E >::value &&detail_expected::is_swappable< E >::value > * = nullptr>
void wpi::util::swap (expected< T, E > &lhs, expected< T, E > &rhs) noexcept(noexcept(lhs.swap(rhs)))

Variables

static constexpr in_place_t wpi::util::in_place {}
static constexpr unexpect_t wpi::util::unexpect {}
static constexpr no_init_t wpi::util::detail_expected::no_init {}

Macro Definition Documentation

◆ WPI_ASSERT

#define WPI_ASSERT ( x)

◆ WPI_EXPECTED_11_CONSTEXPR

#define WPI_EXPECTED_11_CONSTEXPR   constexpr

◆ WPI_EXPECTED_GCC49_CONSTEXPR

#define WPI_EXPECTED_GCC49_CONSTEXPR   constexpr

◆ WPI_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE

#define WPI_EXPECTED_IS_TRIVIALLY_COPY_ASSIGNABLE ( T)
Value:
std::is_trivially_copy_assignable<T>

◆ WPI_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE

#define WPI_EXPECTED_IS_TRIVIALLY_COPY_CONSTRUCTIBLE ( T)
Value:
std::is_trivially_copy_constructible<T>

◆ WPI_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE

#define WPI_EXPECTED_IS_TRIVIALLY_DESTRUCTIBLE ( T)
Value:
std::is_trivially_destructible<T>

◆ WPI_EXPECTED_MSVC2015_CONSTEXPR

#define WPI_EXPECTED_MSVC2015_CONSTEXPR   constexpr

◆ WPI_EXPECTED_VERSION_MAJOR

#define WPI_EXPECTED_VERSION_MAJOR   1

◆ WPI_EXPECTED_VERSION_MINOR

#define WPI_EXPECTED_VERSION_MINOR   1

◆ WPI_EXPECTED_VERSION_PATCH

#define WPI_EXPECTED_VERSION_PATCH   0

◆ WPI_MONOSTATE_INPLACE_MUTEX

#define WPI_MONOSTATE_INPLACE_MUTEX

◆ WPI_TRAITS_MUTEX

#define WPI_TRAITS_MUTEX