plugify 1.2.8
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
plg::expected< T, E > Class Template Reference
Collaboration diagram for plg::expected< T, E >:
Collaboration graph
[legend]

Public Types

using value_type = T
 
using error_type = E
 
using unexpected_type = unexpected< E >
 
template<class U >
using rebind = expected< U, error_type >
 
using GF = G const &
 
using GF = G const &
 

Public Member Functions

constexpr expected (expected const &rhs)=default
 
constexpr expected (expected const &rhs)
 
constexpr expected (expected &&) noexcept(std::is_nothrow_move_constructible_v< T > &&std::is_nothrow_move_constructible_v< E >)=default
 
constexpr expected (expected &&rhs) noexcept(std::is_nothrow_move_constructible_v< T > &&std::is_nothrow_move_constructible_v< E >)
 
template<class U , class G >
requires detail::expected_constructible_from_other<T, E, U, G, U const&, G const&>
constexpr explicit (!std::convertible_to< U const &, T >||!std::convertible_to< G const &, E >) expected(expected< U
 
 if (rhs.has_value())
 
template<class U , class G >
requires detail::expected_constructible_from_other<T, E, U, G, U, G>
constexpr explicit (!std::convertible_to< U, T >||!std::convertible_to< G, E >) expected(expected< U
 
 if (rhs.has_value())
 
template<class U = T>
requires (!std::same_as<std::remove_cvref_t<U>, std::in_place_t>) && (!std::same_as<expected<T, E>, std::remove_cvref_t<U>>) && (!detail::is_unexpected<U>) && std::constructible_from<T, U>
constexpr explicit (!std::convertible_to< U, T >) expected(U &&v)
 
template<class G >
requires std::constructible_from<E, G const&>
constexpr explicit (!std::convertible_to< G const &, E >) expected(unexpected< G > const &e)
 
template<class G >
requires std::constructible_from<E, G>
constexpr explicit (!std::convertible_to< G, E >) expected(unexpected< G > &&e)
 
template<class... Args>
requires std::constructible_from<T, Args...>
constexpr expected (std::in_place_t, Args &&... args)
 
template<class U , class... Args>
requires std::constructible_from<T, std::initializer_list<U>&, Args...>
constexpr expected (std::in_place_t, std::initializer_list< U > il, Args &&... args)
 
template<class... Args>
requires std::constructible_from<E, Args...>
constexpr expected (unexpect_t, Args &&... args)
 
template<class U , class... Args>
requires std::constructible_from<E, std::initializer_list<U>&, Args...>
constexpr expected (unexpect_t, std::initializer_list< U > il, Args &&... args)
 
constexpr auto operator= (expected const &rhs) -> expected &
 
constexpr auto operator= (expected &&rhs) noexcept(std::is_nothrow_move_assignable_v< T > &&std::is_nothrow_move_constructible_v< T > &&std::is_nothrow_move_assignable_v< E > &&std::is_nothrow_move_constructible_v< E >) -> expected &
 
template<class U = T>
constexpr auto operator= (U &&rhs) -> expected &requires(!std::same_as< expected, std::remove_cvref_t< U > >) &&(!detail::is_unexpected< std::remove_cvref_t< U > >) &&std::constructible_from< T, U > &&std::is_assignable_v< T &, U > &&(std::is_nothrow_constructible_v< T, U >||std::is_nothrow_move_constructible_v< T >||std::is_nothrow_move_constructible_v< E >)
 
template<class G >
requires std::constructible_from<E, G const&> && std::is_assignable_v<E&, G const&> && (std::is_nothrow_constructible_v<E, G const&> || std::is_nothrow_move_constructible_v<T> || std::is_nothrow_move_constructible_v<E>)
constexpr auto operator= (unexpected< G > const &e) -> expected &
 
template<class G >
requires std::constructible_from<E, G> && std::is_assignable_v<E&, G> && (std::is_nothrow_constructible_v<E, G> || std::is_nothrow_move_constructible_v<T> || std::is_nothrow_move_constructible_v<E>)
constexpr auto operator= (unexpected< G > &&e) -> expected &
 
template<class... Args>
requires std::is_nothrow_constructible_v<T, Args...>
constexpr auto emplace (Args &&... args) noexcept -> T &
 
template<class U , class... Args>
requires std::is_nothrow_constructible_v<T, std::initializer_list<U>&, Args...>
constexpr auto emplace (std::initializer_list< U > il, Args &&... args) noexcept -> T &
 
constexpr void swap (expected &rhs) noexcept(std::is_nothrow_constructible_v< T > &&std::is_nothrow_swappable_v< T > &&std::is_nothrow_move_constructible_v< E > &&std::is_nothrow_swappable_v< E >)
 
constexpr auto operator-> () const noexcept -> T const *
 
constexpr auto operator-> () noexcept -> T *
 
constexpr auto operator* () const &noexcept -> T const &
 
constexpr auto operator* () &noexcept -> T &
 
constexpr auto operator* () const &&noexcept -> T const &&
 
constexpr auto operator* () &&noexcept -> T &&
 
constexpr operator bool () const noexcept
 
constexpr auto has_value () const noexcept -> bool
 
constexpr auto value () const &-> T const &
 
constexpr auto value () &-> T &
 
constexpr auto value () const &&-> T const &&
 
constexpr auto value () &&-> T &&
 
constexpr auto error () const &-> E const &
 
constexpr auto error () &-> E &
 
constexpr auto error () const &&-> E const &&
 
constexpr auto error () &&-> E &&
 
template<class U >
requires std::is_copy_constructible_v<T> && std::is_convertible_v<U, T>
constexpr auto value_or (U &&v) const &-> T
 
template<class U >
requires std::is_move_constructible_v<T> && std::is_convertible_v<U, T>
constexpr auto value_or (U &&v) &&-> T
 
template<class F , class V = T&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<U> && std::is_same_v<typename U::error_type, E> && std::is_copy_constructible_v<E> && std::is_copy_constructible_v<T>
constexpr auto and_then (F &&f) &
 
template<class F , class V = T const&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<U> && std::is_same_v<typename U::error_type, E> && std::is_copy_constructible_v<E> && std::is_copy_constructible_v<T>
constexpr auto and_then (F &&f) const &
 
template<class F , class V = T&&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<U> && std::is_same_v<typename U::error_type, E> && std::is_move_constructible_v<E> && std::is_move_constructible_v<T>
constexpr auto and_then (F &&f) &&
 
template<class F , class V = T const&&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<U> && std::is_same_v<typename U::error_type, E> && std::is_move_constructible_v<E> && std::is_move_constructible_v<T>
constexpr auto and_then (F &&f) const &&
 
template<class F , class V = E&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<G> && std::is_same_v<typename G::value_type, T> && std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto or_else (F &&f) &
 
template<class F , class V = E const&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<G> && std::is_same_v<typename G::value_type, T> && std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto or_else (F &&f) const &
 
template<class F , class V = E&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<G> && std::is_same_v<typename G::value_type, T> && std::is_move_constructible_v<T> && std::is_move_constructible_v<E>
constexpr auto or_else (F &&f) &&
 
template<class F , class V = E const&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<G> && std::is_same_v<typename G::value_type, T> && std::is_move_constructible_v<T> && std::is_move_constructible_v<E>
constexpr auto or_else (F &&f) const &&
 
template<class F , class V = E&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_void_v<G> && std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto or_else (F &&f) &
 
template<class F , class V = E const&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_void_v<G> && std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto or_else (F &&f) const &
 
template<class F , class V = E&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_void_v<G> && std::is_move_constructible_v<T> && std::is_move_constructible_v<E> && std::is_copy_constructible_v<E>
constexpr auto or_else (F &&f) &&
 
template<class F , class V = E const&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_void_v<G> && std::is_move_constructible_v<T> && std::is_move_constructible_v<E> && std::is_copy_constructible_v<E>
constexpr auto or_else (F &&f) const &&
 
template<class F , class V = T&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_copy_constructible_v<E> && std::is_copy_constructible_v<T>
constexpr auto transform (F &&f) &
 
template<class F , class V = T const&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_copy_constructible_v<E> && std::is_copy_constructible_v<T>
constexpr auto transform (F &&f) const &
 
template<class F , class V = T&&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_move_constructible_v<E> && std::is_move_constructible_v<T>
constexpr auto transform (F &&f) &&
 
template<class F , class V = T const&&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_move_constructible_v<E> && std::is_move_constructible_v<T>
constexpr auto transform (F &&f) const &&
 
template<class F , class V = E&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto transform_error (F &&f) &
 
template<class F , class V = E const&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto transform_error (F &&f) const &
 
template<class F , class V = E&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_move_constructible_v<T> && std::is_move_constructible_v<E>
constexpr auto transform_error (F &&f) &&
 
template<class F , class V = E const&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_move_constructible_v<T> && std::is_move_constructible_v<E>
constexpr auto transform_error (F &&f) const &&
 

Public Attributes

constexpr G constrhs: has_val(rhs.has_value()) { using UF = U const&
 
 else
 
constexpr G && rhs: has_val(rhs.has_value()) { using UF = U const&
 

Friends

template<class T2 , class E2 >
requires (!std::is_void_v<T2>) && requires(T const& t1, T2 const& t2, E const& e1, E2 const& e2) { { t1 == t2 } -> std::convertible_to<bool>; { e1 == e2 } -> std::convertible_to<bool>; }
constexpr auto operator== (expected const &x, expected< T2, E2 > const &y) -> bool
 
template<class T2 >
requires (!detail::is_expected<T2>) && requires(T const& x, T2 const& v) { { x == v } -> std::convertible_to<bool>; }
constexpr auto operator== (expected const &x, T2 const &v) -> bool
 
template<class E2 >
requires requires(E const& x, unexpected<E2> const& e) { { x == e.value() } -> std::convertible_to<bool>; }
constexpr auto operator== (expected const &x, unexpected< E2 > const &e) -> bool
 
constexpr void swap (expected &x, expected &y) noexcept(noexcept(x.swap(y)))
 

Detailed Description

template<detail::non_void_destructible T, std::destructible E>
class plg::expected< T, E >

Definition at line 194 of file expected.hpp.

Member Typedef Documentation

◆ error_type

template<detail::non_void_destructible T, std::destructible E>
using plg::expected< T, E >::error_type = E

Definition at line 197 of file expected.hpp.

◆ GF [1/2]

template<detail::non_void_destructible T, std::destructible E>
using plg::expected< T, E >::GF = G const&

Definition at line 255 of file expected.hpp.

◆ GF [2/2]

template<detail::non_void_destructible T, std::destructible E>
using plg::expected< T, E >::GF = G const&

Definition at line 270 of file expected.hpp.

◆ rebind

template<detail::non_void_destructible T, std::destructible E>
template<class U >
using plg::expected< T, E >::rebind = expected<U, error_type>

Definition at line 201 of file expected.hpp.

◆ unexpected_type

template<detail::non_void_destructible T, std::destructible E>
using plg::expected< T, E >::unexpected_type = unexpected<E>

Definition at line 198 of file expected.hpp.

◆ value_type

template<detail::non_void_destructible T, std::destructible E>
using plg::expected< T, E >::value_type = T

Definition at line 196 of file expected.hpp.

Constructor & Destructor Documentation

◆ expected() [1/7]

template<detail::non_void_destructible T, std::destructible E>
constexpr plg::expected< T, E >::expected ( )
inlineconstexpr

Definition at line 205 of file expected.hpp.

◆ expected() [2/7]

template<detail::non_void_destructible T, std::destructible E>
constexpr plg::expected< T, E >::expected ( expected< T, E > const rhs)
inlineconstexpr

Definition at line 217 of file expected.hpp.

◆ expected() [3/7]

template<detail::non_void_destructible T, std::destructible E>
constexpr plg::expected< T, E >::expected ( expected< T, E > &&  rhs)
inlineconstexprnoexcept

Definition at line 235 of file expected.hpp.

◆ expected() [4/7]

template<detail::non_void_destructible T, std::destructible E>
template<class... Args>
requires std::constructible_from<T, Args...>
constexpr plg::expected< T, E >::expected ( std::in_place_t  ,
Args &&...  args 
)
inlineexplicitconstexpr

Definition at line 301 of file expected.hpp.

◆ expected() [5/7]

template<detail::non_void_destructible T, std::destructible E>
template<class U , class... Args>
requires std::constructible_from<T, std::initializer_list<U>&, Args...>
constexpr plg::expected< T, E >::expected ( std::in_place_t  ,
std::initializer_list< U il,
Args &&...  args 
)
inlineexplicitconstexpr

Definition at line 306 of file expected.hpp.

◆ expected() [6/7]

template<detail::non_void_destructible T, std::destructible E>
template<class... Args>
requires std::constructible_from<E, Args...>
constexpr plg::expected< T, E >::expected ( unexpect_t  ,
Args &&...  args 
)
inlineexplicitconstexpr

Definition at line 313 of file expected.hpp.

◆ expected() [7/7]

template<detail::non_void_destructible T, std::destructible E>
template<class U , class... Args>
requires std::constructible_from<E, std::initializer_list<U>&, Args...>
constexpr plg::expected< T, E >::expected ( unexpect_t  ,
std::initializer_list< U il,
Args &&...  args 
)
inlineexplicitconstexpr

Definition at line 319 of file expected.hpp.

◆ ~expected()

template<detail::non_void_destructible T, std::destructible E>
constexpr plg::expected< T, E >::~expected ( )
inlineconstexpr

Definition at line 326 of file expected.hpp.

Member Function Documentation

◆ and_then() [1/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = T&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<U> && std::is_same_v<typename U::error_type, E> && std::is_copy_constructible_v<E> && std::is_copy_constructible_v<T>
constexpr auto plg::expected< T, E >::and_then ( F &&  f) &
inlineconstexpr

Definition at line 641 of file expected.hpp.

◆ and_then() [2/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = T&&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<U> && std::is_same_v<typename U::error_type, E> && std::is_move_constructible_v<E> && std::is_move_constructible_v<T>
constexpr auto plg::expected< T, E >::and_then ( F &&  f) &&
inlineconstexpr

Definition at line 667 of file expected.hpp.

◆ and_then() [3/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = T const&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<U> && std::is_same_v<typename U::error_type, E> && std::is_copy_constructible_v<E> && std::is_copy_constructible_v<T>
constexpr auto plg::expected< T, E >::and_then ( F &&  f) const &
inlineconstexpr

Definition at line 654 of file expected.hpp.

◆ and_then() [4/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = T const&&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<U> && std::is_same_v<typename U::error_type, E> && std::is_move_constructible_v<E> && std::is_move_constructible_v<T>
constexpr auto plg::expected< T, E >::and_then ( F &&  f) const &&
inlineconstexpr

Definition at line 680 of file expected.hpp.

◆ emplace() [1/2]

template<detail::non_void_destructible T, std::destructible E>
template<class... Args>
requires std::is_nothrow_constructible_v<T, Args...>
constexpr auto plg::expected< T, E >::emplace ( Args &&...  args) -> T&
inlineconstexprnoexcept

Definition at line 449 of file expected.hpp.

◆ emplace() [2/2]

template<detail::non_void_destructible T, std::destructible E>
template<class U , class... Args>
requires std::is_nothrow_constructible_v<T, std::initializer_list<U>&, Args...>
constexpr auto plg::expected< T, E >::emplace ( std::initializer_list< U il,
Args &&...  args 
) -> T&
inlineconstexprnoexcept

Definition at line 462 of file expected.hpp.

◆ error() [1/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::error ( ) && -> E&&
inlineconstexpr

Definition at line 619 of file expected.hpp.

◆ error() [2/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::error ( ) & -> E&
inlineconstexpr

Definition at line 607 of file expected.hpp.

◆ error() [3/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::error ( ) const && -> E const&&
inlineconstexpr

Definition at line 613 of file expected.hpp.

◆ error() [4/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::error ( ) const & -> E const&
inlineconstexpr

Definition at line 601 of file expected.hpp.

◆ explicit() [1/3]

template<detail::non_void_destructible T, std::destructible E>
template<class G >
requires std::constructible_from<E, G const&>
constexpr plg::expected< T, E >::explicit ( !std::convertible_to< G const &, E >  ) const &
inlineconstexpr

Definition at line 289 of file expected.hpp.

◆ explicit() [2/3]

template<detail::non_void_destructible T, std::destructible E>
template<class G >
requires std::constructible_from<E, G>
constexpr plg::expected< T, E >::explicit ( !std::convertible_to< G, E >  ) &&
inlineconstexpr

Definition at line 295 of file expected.hpp.

◆ explicit() [3/3]

template<detail::non_void_destructible T, std::destructible E>
template<class U = T>
requires (!std::same_as<std::remove_cvref_t<U>, std::in_place_t>) && (!std::same_as<expected<T, E>, std::remove_cvref_t<U>>) && (!detail::is_unexpected<U>) && std::constructible_from<T, U>
constexpr plg::expected< T, E >::explicit ( !std::convertible_to< U, T >  ) &&
inlineconstexpr

Definition at line 284 of file expected.hpp.

◆ has_value()

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::has_value ( ) const -> bool
inlineconstexprnoexcept

Definition at line 568 of file expected.hpp.

◆ if() [1/2]

template<detail::non_void_destructible T, std::destructible E>
plg::expected< T, E >::if ( rhs.  has_value())
inline

Definition at line 256 of file expected.hpp.

◆ if() [2/2]

template<detail::non_void_destructible T, std::destructible E>
plg::expected< T, E >::if ( rhs.  has_value())
inline

Definition at line 271 of file expected.hpp.

◆ operator bool()

template<detail::non_void_destructible T, std::destructible E>
constexpr plg::expected< T, E >::operator bool ( ) const
inlineexplicitconstexprnoexcept

Definition at line 566 of file expected.hpp.

◆ operator*() [1/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::operator* ( ) && -> T&&
inlineconstexprnoexcept

Definition at line 561 of file expected.hpp.

◆ operator*() [2/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::operator* ( ) & -> T&
inlineconstexprnoexcept

Definition at line 549 of file expected.hpp.

◆ operator*() [3/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::operator* ( ) const && -> T const&&
inlineconstexprnoexcept

Definition at line 555 of file expected.hpp.

◆ operator*() [4/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::operator* ( ) const & -> T const&
inlineconstexprnoexcept

Definition at line 543 of file expected.hpp.

◆ operator->() [1/2]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::operator-> ( ) const -> T const*
inlineconstexprnoexcept

Definition at line 531 of file expected.hpp.

◆ operator->() [2/2]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::operator-> ( ) -> T*
inlineconstexprnoexcept

Definition at line 537 of file expected.hpp.

◆ operator=() [1/5]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::operator= ( expected< T, E > &&  rhs) -> expected&
inlineconstexprnoexcept

Definition at line 369 of file expected.hpp.

◆ operator=() [2/5]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::operator= ( expected< T, E > const rhs) -> expected&
inlineconstexpr

Definition at line 347 of file expected.hpp.

◆ operator=() [3/5]

template<detail::non_void_destructible T, std::destructible E>
template<class U = T>
constexpr auto plg::expected< T, E >::operator= ( U &&  rhs) -> expected& requires(!std::same_as<expected, std::remove_cvref_t<U>>) && (!detail::is_unexpected<std::remove_cvref_t<U>>) && std::constructible_from<T, U>&& std::is_assignable_v<T&, U> && (std::is_nothrow_constructible_v<T, U> || std::is_nothrow_move_constructible_v<T> || std::is_nothrow_move_constructible_v<E>)
inlineconstexpr

Definition at line 395 of file expected.hpp.

◆ operator=() [4/5]

template<detail::non_void_destructible T, std::destructible E>
template<class G >
requires std::constructible_from<E, G> && std::is_assignable_v<E&, G> && (std::is_nothrow_constructible_v<E, G> || std::is_nothrow_move_constructible_v<T> || std::is_nothrow_move_constructible_v<E>)
constexpr auto plg::expected< T, E >::operator= ( unexpected< G > &&  e) -> expected&
inlineconstexpr

Definition at line 434 of file expected.hpp.

◆ operator=() [5/5]

template<detail::non_void_destructible T, std::destructible E>
template<class G >
requires std::constructible_from<E, G const&> && std::is_assignable_v<E&, G const&> && (std::is_nothrow_constructible_v<E, G const&> || std::is_nothrow_move_constructible_v<T> || std::is_nothrow_move_constructible_v<E>)
constexpr auto plg::expected< T, E >::operator= ( unexpected< G > const e) -> expected&
inlineconstexpr

Definition at line 416 of file expected.hpp.

◆ or_else() [1/8]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<G> && std::is_same_v<typename G::value_type, T> && std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto plg::expected< T, E >::or_else ( F &&  f) &
inlineconstexpr

Definition at line 693 of file expected.hpp.

◆ or_else() [2/8]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_void_v<G> && std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto plg::expected< T, E >::or_else ( F &&  f) &
inlineconstexpr

Definition at line 744 of file expected.hpp.

◆ or_else() [3/8]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<G> && std::is_same_v<typename G::value_type, T> && std::is_move_constructible_v<T> && std::is_move_constructible_v<E>
constexpr auto plg::expected< T, E >::or_else ( F &&  f) &&
inlineconstexpr

Definition at line 719 of file expected.hpp.

◆ or_else() [4/8]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_void_v<G> && std::is_move_constructible_v<T> && std::is_move_constructible_v<E> && std::is_copy_constructible_v<E>
constexpr auto plg::expected< T, E >::or_else ( F &&  f) &&
inlineconstexpr

Definition at line 771 of file expected.hpp.

◆ or_else() [5/8]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E const&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<G> && std::is_same_v<typename G::value_type, T> && std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto plg::expected< T, E >::or_else ( F &&  f) const &
inlineconstexpr

Definition at line 706 of file expected.hpp.

◆ or_else() [6/8]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E const&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_void_v<G> && std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto plg::expected< T, E >::or_else ( F &&  f) const &
inlineconstexpr

Definition at line 757 of file expected.hpp.

◆ or_else() [7/8]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E const&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires detail::is_expected<G> && std::is_same_v<typename G::value_type, T> && std::is_move_constructible_v<T> && std::is_move_constructible_v<E>
constexpr auto plg::expected< T, E >::or_else ( F &&  f) const &&
inlineconstexpr

Definition at line 732 of file expected.hpp.

◆ or_else() [8/8]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E const&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_void_v<G> && std::is_move_constructible_v<T> && std::is_move_constructible_v<E> && std::is_copy_constructible_v<E>
constexpr auto plg::expected< T, E >::or_else ( F &&  f) const &&
inlineconstexpr

Definition at line 786 of file expected.hpp.

◆ swap()

template<detail::non_void_destructible T, std::destructible E>
constexpr void plg::expected< T, E >::swap ( expected< T, E > &  rhs)
inlineconstexprnoexcept

Definition at line 475 of file expected.hpp.

◆ transform() [1/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = T&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_copy_constructible_v<E> && std::is_copy_constructible_v<T>
constexpr auto plg::expected< T, E >::transform ( F &&  f) &
inlineconstexpr

Definition at line 799 of file expected.hpp.

◆ transform() [2/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = T&&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_move_constructible_v<E> && std::is_move_constructible_v<T>
constexpr auto plg::expected< T, E >::transform ( F &&  f) &&
inlineconstexpr

Definition at line 831 of file expected.hpp.

◆ transform() [3/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = T const&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_copy_constructible_v<E> && std::is_copy_constructible_v<T>
constexpr auto plg::expected< T, E >::transform ( F &&  f) const &
inlineconstexpr

Definition at line 815 of file expected.hpp.

◆ transform() [4/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = T const&&, class U = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_move_constructible_v<E> && std::is_move_constructible_v<T>
constexpr auto plg::expected< T, E >::transform ( F &&  f) const &&
inlineconstexpr

Definition at line 848 of file expected.hpp.

◆ transform_error() [1/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto plg::expected< T, E >::transform_error ( F &&  f) &
inlineconstexpr

Definition at line 865 of file expected.hpp.

◆ transform_error() [2/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_move_constructible_v<T> && std::is_move_constructible_v<E>
constexpr auto plg::expected< T, E >::transform_error ( F &&  f) &&
inlineconstexpr

Definition at line 887 of file expected.hpp.

◆ transform_error() [3/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E const&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_copy_constructible_v<T> && std::is_copy_constructible_v<E>
constexpr auto plg::expected< T, E >::transform_error ( F &&  f) const &
inlineconstexpr

Definition at line 876 of file expected.hpp.

◆ transform_error() [4/4]

template<detail::non_void_destructible T, std::destructible E>
template<class F , class V = E const&&, class G = std::remove_cvref_t<std::invoke_result_t<F, V>>>
requires std::is_move_constructible_v<T> && std::is_move_constructible_v<E>
constexpr auto plg::expected< T, E >::transform_error ( F &&  f) const &&
inlineconstexpr

Definition at line 899 of file expected.hpp.

◆ value() [1/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::value ( ) && -> T&&
inlineconstexpr

Definition at line 593 of file expected.hpp.

◆ value() [2/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::value ( ) & -> T&
inlineconstexpr

Definition at line 579 of file expected.hpp.

◆ value() [3/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::value ( ) const && -> T const&&
inlineconstexpr

Definition at line 586 of file expected.hpp.

◆ value() [4/4]

template<detail::non_void_destructible T, std::destructible E>
constexpr auto plg::expected< T, E >::value ( ) const & -> T const&
inlineconstexpr

Definition at line 572 of file expected.hpp.

◆ value_or() [1/2]

template<detail::non_void_destructible T, std::destructible E>
template<class U >
requires std::is_move_constructible_v<T> && std::is_convertible_v<U, T>
constexpr auto plg::expected< T, E >::value_or ( U &&  v) && -> T
inlineconstexpr

Definition at line 632 of file expected.hpp.

◆ value_or() [2/2]

template<detail::non_void_destructible T, std::destructible E>
template<class U >
requires std::is_copy_constructible_v<T> && std::is_convertible_v<U, T>
constexpr auto plg::expected< T, E >::value_or ( U &&  v) const & -> T
inlineconstexpr

Definition at line 626 of file expected.hpp.

Friends And Related Symbol Documentation

◆ operator== [1/3]

template<detail::non_void_destructible T, std::destructible E>
template<class T2 , class E2 >
requires (!std::is_void_v<T2>) && requires(T const& t1, T2 const& t2, E const& e1, E2 const& e2) { { t1 == t2 } -> std::convertible_to<bool>; { e1 == e2 } -> std::convertible_to<bool>; }
constexpr auto operator== ( expected< T, E > const x,
expected< T2, E2 > const y 
) -> bool
friend

Definition at line 914 of file expected.hpp.

◆ operator== [2/3]

template<detail::non_void_destructible T, std::destructible E>
template<class T2 >
requires (!detail::is_expected<T2>) && requires(T const& x, T2 const& v) { { x == v } -> std::convertible_to<bool>; }
constexpr auto operator== ( expected< T, E > const x,
T2 const v 
) -> bool
friend

Definition at line 926 of file expected.hpp.

◆ operator== [3/3]

template<detail::non_void_destructible T, std::destructible E>
template<class E2 >
requires requires(E const& x, unexpected<E2> const& e) { { x == e.value() } -> std::convertible_to<bool>; }
constexpr auto operator== ( expected< T, E > const x,
unexpected< E2 > const e 
) -> bool
friend

Definition at line 934 of file expected.hpp.

◆ swap

template<detail::non_void_destructible T, std::destructible E>
constexpr void swap ( expected< T, E > &  x,
expected< T, E > &  y 
)
friend

Definition at line 940 of file expected.hpp.

Member Data Documentation

◆ else

template<detail::non_void_destructible T, std::destructible E>
plg::expected< T, E >::else
Initial value:
{
std::construct_at(std::addressof(this->unex),
std::forward<GF>(rhs.error()))

Definition at line 258 of file expected.hpp.

◆ rhs [1/2]

template<detail::non_void_destructible T, std::destructible E>
constexpr G const& plg::expected< T, E >::rhs

Definition at line 252 of file expected.hpp.

◆ rhs [2/2]

template<detail::non_void_destructible T, std::destructible E>
constexpr G&& plg::expected< T, E >::rhs

Definition at line 267 of file expected.hpp.

◆ unex

template<detail::non_void_destructible T, std::destructible E>
E plg::expected< T, E >::unex

Definition at line 949 of file expected.hpp.

◆ val

template<detail::non_void_destructible T, std::destructible E>
T plg::expected< T, E >::val

Definition at line 948 of file expected.hpp.


The documentation for this class was generated from the following file: