Template Class Expected< T, E >#

Class Documentation#

template<typename T, typename E>
class Expected<T, E>#

Public Types

using value_type = T#
using error_type = E#
using unexpected_type = Unexpected<E>#
template<typename U>
using rebind = Expected<U, error_type>#

Public Functions

inline constexpr Expected() noexcept#
constexpr Expected(const Expected &other) = default#
inline constexpr Expected(const Expected &other) noexcept(std::is_nothrow_copy_constructible_v<E>)
constexpr Expected(Expected &&other) = default#
inline constexpr Expected(Expected &&other) noexcept(std::is_nothrow_move_constructible_v<E>)
template<typename U, typename G> constexpr explicit (!std::is_convertible_v< const G &, E >) Expected(const Expected< U
inline constexpr G &other noexcept (std::is_nothrow_constructible_v< E, const G & >)
template<typename U, typename G> constexpr explicit (!std::is_convertible_v< G, E >) Expected(Expected< U
inline constexpr G &&other noexcept (std::is_nothrow_constructible_v< E, G >)
template<typename G = E>
inline explicit(!std::is_convertible_v<const G&, E>) constexpr Expected(const Unexpected<G> &u) noexcept(std::is_nothrow_constructible_v<E, const G&>)#
template<typename G = E>
inline explicit(!std::is_convertible_v<G, E>) constexpr Expected(Unexpected<G> &&u) noexcept(std::is_nothrow_constructible_v<E, G>)#
inline explicit constexpr Expected(std::in_place_t _) noexcept#
template<typename ...Args>
inline explicit constexpr Expected(Unexpect_t _, Args&&... args) noexcept(std::is_nothrow_constructible_v<E, Args...>)#
template<typename U, typename ...Args>
inline explicit constexpr Expected(Unexpect_t _, std::initializer_list<U> il, Args&&... args) noexcept(std::is_nothrow_constructible_v<E, std::initializer_list<U>&, Args...>)#
constexpr ~Expected() = default#
inline constexpr ~Expected()
consteval Expected &operator=(const Expected &other) = delete#
inline constexpr Expected &operator=(const Expected &other) noexcept(std::conjunction_v<std::is_nothrow_copy_constructible<E>, std::is_nothrow_copy_assignable<E>>)
inline constexpr Expected &operator=(Expected &&other) noexcept(std::conjunction_v<std::is_nothrow_move_constructible<E>, std::is_nothrow_move_assignable<E>>)#
template<typename G>
inline constexpr Expected &operator=(const Unexpected<G> &e)#
template<typename G>
inline constexpr Expected &operator=(Unexpected<G> &&e)#
inline constexpr void Emplace() noexcept#
inline constexpr void Swap(Expected &other) noexcept(std::conjunction_v<std::is_nothrow_swappable<E&>, std::is_nothrow_move_constructible<E>>)#
inline explicit constexpr operator bool() const noexcept#
inline constexpr bool HasValue() const noexcept#
inline constexpr void operator*() const noexcept#
inline constexpr void Value() const &#
inline constexpr void Value() &&#
template<typename F>
inline constexpr void ValueOrElse(F &&f) const &#
template<typename F>
inline constexpr void ValueOrElse(F &&f) &&#
inline constexpr const E &Error() const & noexcept#
inline constexpr E &Error() & noexcept#
inline constexpr const E &&Error() const && noexcept#
inline constexpr E &&Error() && noexcept#
template<typename G = E>
inline constexpr E ErrorOr(G &&e) const &#
template<typename G = E>
inline constexpr E ErrorOr(G &&e) &&#
template<typename Fn>
inline constexpr auto AndThen(Fn &&f) &#
template<typename Fn>
inline constexpr auto AndThen(Fn &&f) const &#
template<typename Fn>
inline constexpr auto AndThen(Fn &&f) &&#
template<typename Fn>
inline constexpr auto AndThen(Fn &&f) const &&#
template<typename Fn>
inline constexpr auto OrElse(Fn &&f) &#
template<typename Fn>
inline constexpr auto OrElse(Fn &&f) const &#
template<typename Fn>
inline constexpr auto OrElse(Fn &&f) &&#
template<typename Fn>
inline constexpr auto OrElse(Fn &&f) const &&#
template<typename Fn>
inline constexpr auto Transform(Fn &&f) &#
template<typename Fn>
inline constexpr auto Transform(Fn &&f) const &#
template<typename Fn>
inline constexpr auto Transform(Fn &&f) &&#
template<typename Fn>
inline constexpr auto Transform(Fn &&f) const &&#
template<typename Fn>
inline constexpr auto TransformError(Fn &&f) &#
template<typename Fn>
inline constexpr auto TransformError(Fn &&f) const &#
template<typename Fn>
inline constexpr auto TransformError(Fn &&f) &&#
template<typename Fn>
inline constexpr auto TransformError(Fn &&f) const &&#

Public Members

struct TRAP::Expected<T, E>::[anonymous]::[anonymous] m_void#
E m_unexpected#

Friends

template<typename U, typename E2>
inline friend constexpr bool operator==(const Expected &lhs, const Expected<U, E2> &rhs)#
template<typename E2>
inline friend constexpr bool operator==(const Expected &lhs, const Unexpected<E2> &rhs)#
inline friend constexpr void swap(Expected &lhs, Expected &rhs) noexcept(noexcept(lhs.Swap(rhs)))#