ThreadSchedule 1.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::expected< T, E > Class Template Reference
Inheritance diagram for threadschedule::expected< T, E >:
[legend]

Public Types

using value_type = T
using error_type = E
using unexpected_type = unexpected<E>

Public Member Functions

constexpr expected (expected const &other)
constexpr expected (expected &&other) noexcept(std::is_nothrow_move_constructible_v< T > &&std::is_nothrow_move_constructible_v< E >)
template<typename U = T, typename = std::enable_if_t< !std::is_same_v<std::decay_t<U>, expected> && !std::is_same_v<std::decay_t<U>, std::in_place_t> && !std::is_same_v<std::decay_t<U>, unexpected<E>> && std::is_constructible_v<T, U>>>
constexpr expected (U &&value, std::enable_if_t< std::is_convertible_v< U, T >, int >=0)
template<typename U = T, typename = std::enable_if_t<!std::is_same_v<std::decay_t<U>, expected> && !std::is_same_v<std::decay_t<U>, std::in_place_t> && !std::is_same_v<std::decay_t<U>, unexpected<E>> && std::is_constructible_v<T, U> && !std::is_convertible_v<U, T>>>
constexpr expected (U &&value)
template<typename... Args, typename = std::enable_if_t<std::is_constructible_v<T, Args...>>>
constexpr expected (std::in_place_t, Args &&... args)
constexpr expected (unexpected< E > const &ue)
constexpr expected (unexpected< E > &&ue)
template<typename... Args>
constexpr expected (unexpect_t, Args &&... args)
constexpr auto operator= (expected const &other) -> expected &
constexpr auto operator= (expected &&other) noexcept(std::is_nothrow_move_constructible_v< T > &&std::is_nothrow_move_constructible_v< E >) -> expected &
template<typename U = T, typename = std::enable_if_t<!std::is_same_v<std::decay_t<U>, expected> && std::is_constructible_v<T, U>>>
constexpr auto operator= (U &&value) -> expected &
constexpr auto operator= (unexpected< E > const &ue) -> expected &
constexpr auto operator= (unexpected< E > &&ue) -> expected &
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 &noexcept -> E const &
constexpr auto error () &noexcept -> E &
constexpr auto error () const &&noexcept -> E const &&
constexpr auto error () &&noexcept -> E &&
template<typename U>
constexpr auto value_or (U &&default_value) const &-> T
template<typename U>
constexpr auto value_or (U &&default_value) &&-> T
template<typename... Args>
constexpr auto emplace (Args &&... args) -> T &
constexpr void swap (expected &other) noexcept(std::is_nothrow_move_constructible_v< T > &&std::is_nothrow_move_constructible_v< E > &&std::is_nothrow_swappable_v< T > &&std::is_nothrow_swappable_v< E >)
template<typename F>
constexpr auto and_then (F &&f) &
template<typename F>
constexpr auto and_then (F &&f) const &
template<typename F>
constexpr auto and_then (F &&f) &&
template<typename F>
constexpr auto and_then (F &&f) const &&
template<typename F>
constexpr auto or_else (F &&f) &
template<typename F>
constexpr auto or_else (F &&f) const &
template<typename F>
constexpr auto or_else (F &&f) &&
template<typename F>
constexpr auto or_else (F &&f) const &&
template<typename F>
constexpr auto transform (F &&f) &
template<typename F>
constexpr auto transform (F &&f) const &
template<typename F>
constexpr auto transform (F &&f) &&
template<typename F>
constexpr auto transform (F &&f) const &&
template<typename F>
constexpr auto transform_error (F &&f) &
template<typename F>
constexpr auto transform_error (F &&f) const &
template<typename F>
constexpr auto transform_error (F &&f) &&
template<typename F>
constexpr auto transform_error (F &&f) const &&

Friends

template<typename T2, typename E2>
constexpr friend auto operator== (expected const &lhs, expected< T2, E2 > const &rhs) -> bool
template<typename T2, typename E2>
constexpr friend auto operator!= (expected const &lhs, expected< T2, E2 > const &rhs) -> bool
template<typename T2, typename = std::enable_if_t<!std::is_same_v<expected, std::decay_t<T2>>>>
constexpr friend auto operator== (expected const &lhs, const T2 &rhs) -> bool
template<typename T2, typename = std::enable_if_t<!std::is_same_v<expected, std::decay_t<T2>>>>
constexpr friend auto operator== (const T2 &lhs, expected const &rhs) -> bool
template<typename T2, typename = std::enable_if_t<!std::is_same_v<expected, std::decay_t<T2>>>>
constexpr friend auto operator!= (expected const &lhs, const T2 &rhs) -> bool
template<typename T2, typename = std::enable_if_t<!std::is_same_v<expected, std::decay_t<T2>>>>
constexpr friend auto operator!= (const T2 &lhs, expected const &rhs) -> bool
template<typename E2>
constexpr friend auto operator== (expected const &lhs, unexpected< E2 > const &rhs) -> bool
template<typename E2>
constexpr friend auto operator== (unexpected< E2 > const &lhs, expected const &rhs) -> bool
template<typename E2>
constexpr friend auto operator!= (expected const &lhs, unexpected< E2 > const &rhs) -> bool
template<typename E2>
constexpr friend auto operator!= (unexpected< E2 > const &lhs, expected const &rhs) -> bool

Detailed Description

template<typename T, typename E = std::error_code>
class threadschedule::expected< T, E >

Definition at line 133 of file expected.hpp.

Member Typedef Documentation

◆ error_type

template<typename T, typename E = std::error_code>
using threadschedule::expected< T, E >::error_type = E

Definition at line 137 of file expected.hpp.

◆ unexpected_type

template<typename T, typename E = std::error_code>
using threadschedule::expected< T, E >::unexpected_type = unexpected<E>

Definition at line 138 of file expected.hpp.

◆ value_type

template<typename T, typename E = std::error_code>
using threadschedule::expected< T, E >::value_type = T

Definition at line 136 of file expected.hpp.

Constructor & Destructor Documentation

◆ expected() [1/9]

template<typename T, typename E = std::error_code>
template<typename U = T, typename std::enable_if_t< std::is_default_constructible_v< U >, int > = 0>
threadschedule::expected< T, E >::expected ( )
inlineconstexpr

Definition at line 142 of file expected.hpp.

◆ expected() [2/9]

template<typename T, typename E = std::error_code>
threadschedule::expected< T, E >::expected ( expected< T, E > const & other)
inlineconstexpr

Definition at line 150 of file expected.hpp.

◆ expected() [3/9]

template<typename T, typename E = std::error_code>
threadschedule::expected< T, E >::expected ( expected< T, E > && other)
inlineconstexprnoexcept

Definition at line 158 of file expected.hpp.

◆ expected() [4/9]

template<typename T, typename E = std::error_code>
template<typename U = T, typename = std::enable_if_t< !std::is_same_v<std::decay_t<U>, expected> && !std::is_same_v<std::decay_t<U>, std::in_place_t> && !std::is_same_v<std::decay_t<U>, unexpected<E>> && std::is_constructible_v<T, U>>>
threadschedule::expected< T, E >::expected ( U && value,
std::enable_if_t< std::is_convertible_v< U, T >, int > = 0 )
inlineconstexpr

Definition at line 175 of file expected.hpp.

◆ expected() [5/9]

template<typename T, typename E = std::error_code>
template<typename U = T, typename = std::enable_if_t<!std::is_same_v<std::decay_t<U>, expected> && !std::is_same_v<std::decay_t<U>, std::in_place_t> && !std::is_same_v<std::decay_t<U>, unexpected<E>> && std::is_constructible_v<T, U> && !std::is_convertible_v<U, T>>>
threadschedule::expected< T, E >::expected ( U && value)
inlineexplicitconstexpr

Definition at line 185 of file expected.hpp.

◆ expected() [6/9]

template<typename T, typename E = std::error_code>
template<typename... Args, typename = std::enable_if_t<std::is_constructible_v<T, Args...>>>
threadschedule::expected< T, E >::expected ( std::in_place_t ,
Args &&... args )
inlineexplicitconstexpr

Definition at line 192 of file expected.hpp.

◆ expected() [7/9]

template<typename T, typename E = std::error_code>
threadschedule::expected< T, E >::expected ( unexpected< E > const & ue)
inlineconstexpr

Definition at line 197 of file expected.hpp.

◆ expected() [8/9]

template<typename T, typename E = std::error_code>
threadschedule::expected< T, E >::expected ( unexpected< E > && ue)
inlineconstexpr

Definition at line 202 of file expected.hpp.

◆ expected() [9/9]

template<typename T, typename E = std::error_code>
template<typename... Args>
threadschedule::expected< T, E >::expected ( unexpect_t ,
Args &&... args )
inlineexplicitconstexpr

Definition at line 208 of file expected.hpp.

◆ ~expected()

template<typename T, typename E = std::error_code>
threadschedule::expected< T, E >::~expected ( )
inline

Definition at line 278 of file expected.hpp.

Member Function Documentation

◆ and_then() [1/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::and_then ( F && f) &
inlineconstexpr

Definition at line 423 of file expected.hpp.

◆ and_then() [2/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::and_then ( F && f) &&
inlineconstexpr

Definition at line 441 of file expected.hpp.

◆ and_then() [3/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::and_then ( F && f) const &
inlineconstexpr

Definition at line 432 of file expected.hpp.

◆ and_then() [4/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::and_then ( F && f) const &&
inlineconstexpr

Definition at line 450 of file expected.hpp.

◆ emplace()

template<typename T, typename E = std::error_code>
template<typename... Args>
auto threadschedule::expected< T, E >::emplace ( Args &&... args) -> T&
inlineconstexpr

Definition at line 389 of file expected.hpp.

◆ error() [1/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::error ( ) && -> E&&
inlineconstexprnoexcept

Definition at line 370 of file expected.hpp.

◆ error() [2/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::error ( ) & -> E&
inlineconstexprnoexcept

Definition at line 360 of file expected.hpp.

◆ error() [3/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::error ( ) const && -> E const&&
inlinenodiscardconstexprnoexcept

Definition at line 365 of file expected.hpp.

◆ error() [4/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::error ( ) const & -> E const&
inlinenodiscardconstexprnoexcept

Definition at line 355 of file expected.hpp.

◆ has_value()

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::has_value ( ) const -> bool
inlinenodiscardconstexprnoexcept

Definition at line 322 of file expected.hpp.

◆ operator bool()

template<typename T, typename E = std::error_code>
threadschedule::expected< T, E >::operator bool ( ) const
inlineexplicitconstexprnoexcept

Definition at line 317 of file expected.hpp.

◆ operator*() [1/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::operator* ( ) && -> T&&
inlineconstexprnoexcept

Definition at line 312 of file expected.hpp.

◆ operator*() [2/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::operator* ( ) & -> T&
inlineconstexprnoexcept

Definition at line 302 of file expected.hpp.

◆ operator*() [3/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::operator* ( ) const && -> T const&&
inlineconstexprnoexcept

Definition at line 307 of file expected.hpp.

◆ operator*() [4/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::operator* ( ) const & -> T const&
inlineconstexprnoexcept

Definition at line 297 of file expected.hpp.

◆ operator->() [1/2]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::operator-> ( ) const -> T const*
inlineconstexprnoexcept

Definition at line 287 of file expected.hpp.

◆ operator->() [2/2]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::operator-> ( ) -> T*
inlineconstexprnoexcept

Definition at line 292 of file expected.hpp.

◆ operator=() [1/5]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::operator= ( expected< T, E > && other) -> expected&
inlineconstexprnoexcept

Definition at line 223 of file expected.hpp.

◆ operator=() [2/5]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::operator= ( expected< T, E > const & other) -> expected&
inlineconstexpr

Definition at line 214 of file expected.hpp.

◆ operator=() [3/5]

template<typename T, typename E = std::error_code>
template<typename U = T, typename = std::enable_if_t<!std::is_same_v<std::decay_t<U>, expected> && std::is_constructible_v<T, U>>>
auto threadschedule::expected< T, E >::operator= ( U && value) -> expected&
inlineconstexpr

Definition at line 235 of file expected.hpp.

◆ operator=() [4/5]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::operator= ( unexpected< E > && ue) -> expected&
inlineconstexpr

Definition at line 264 of file expected.hpp.

◆ operator=() [5/5]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::operator= ( unexpected< E > const & ue) -> expected&
inlineconstexpr

Definition at line 250 of file expected.hpp.

◆ or_else() [1/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::or_else ( F && f) &
inlineconstexpr

Definition at line 459 of file expected.hpp.

◆ or_else() [2/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::or_else ( F && f) &&
inlineconstexpr

Definition at line 477 of file expected.hpp.

◆ or_else() [3/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::or_else ( F && f) const &
inlineconstexpr

Definition at line 468 of file expected.hpp.

◆ or_else() [4/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::or_else ( F && f) const &&
inlineconstexpr

Definition at line 486 of file expected.hpp.

◆ swap()

template<typename T, typename E = std::error_code>
void threadschedule::expected< T, E >::swap ( expected< T, E > & other)
inlineconstexprnoexcept

Definition at line 397 of file expected.hpp.

◆ transform() [1/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::transform ( F && f) &
inlineconstexpr

Definition at line 495 of file expected.hpp.

◆ transform() [2/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::transform ( F && f) &&
inlineconstexpr

Definition at line 513 of file expected.hpp.

◆ transform() [3/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::transform ( F && f) const &
inlineconstexpr

Definition at line 504 of file expected.hpp.

◆ transform() [4/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::transform ( F && f) const &&
inlineconstexpr

Definition at line 522 of file expected.hpp.

◆ transform_error() [1/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::transform_error ( F && f) &
inlineconstexpr

Definition at line 531 of file expected.hpp.

◆ transform_error() [2/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::transform_error ( F && f) &&
inlineconstexpr

Definition at line 549 of file expected.hpp.

◆ transform_error() [3/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::transform_error ( F && f) const &
inlineconstexpr

Definition at line 540 of file expected.hpp.

◆ transform_error() [4/4]

template<typename T, typename E = std::error_code>
template<typename F>
auto threadschedule::expected< T, E >::transform_error ( F && f) const &&
inlineconstexpr

Definition at line 558 of file expected.hpp.

◆ value() [1/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::value ( ) && -> T&&
inlineconstexpr

Definition at line 348 of file expected.hpp.

◆ value() [2/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::value ( ) & -> T&
inlineconstexpr

Definition at line 334 of file expected.hpp.

◆ value() [3/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::value ( ) const && -> T const&&
inlinenodiscardconstexpr

Definition at line 341 of file expected.hpp.

◆ value() [4/4]

template<typename T, typename E = std::error_code>
auto threadschedule::expected< T, E >::value ( ) const & -> T const&
inlinenodiscardconstexpr

Definition at line 327 of file expected.hpp.

◆ value_or() [1/2]

template<typename T, typename E = std::error_code>
template<typename U>
auto threadschedule::expected< T, E >::value_or ( U && default_value) && -> T
inlineconstexpr

Definition at line 382 of file expected.hpp.

◆ value_or() [2/2]

template<typename T, typename E = std::error_code>
template<typename U>
auto threadschedule::expected< T, E >::value_or ( U && default_value) const & -> T
inlineconstexpr

Definition at line 376 of file expected.hpp.

◆ operator!= [1/5]

template<typename T, typename E = std::error_code>
template<typename T2, typename = std::enable_if_t<!std::is_same_v<expected, std::decay_t<T2>>>>
friend auto operator!= ( const T2 & lhs,
expected< T, E > const & rhs ) -> bool
friend

Definition at line 602 of file expected.hpp.

◆ operator!= [2/5]

template<typename T, typename E = std::error_code>
template<typename T2, typename = std::enable_if_t<!std::is_same_v<expected, std::decay_t<T2>>>>
friend auto operator!= ( expected< T, E > const & lhs,
const T2 & rhs ) -> bool
friend

Definition at line 596 of file expected.hpp.

◆ operator!= [3/5]

template<typename T, typename E = std::error_code>
template<typename T2, typename E2>
friend auto operator!= ( expected< T, E > const & lhs,
expected< T2, E2 > const & rhs ) -> bool
friend

Definition at line 578 of file expected.hpp.

◆ operator!= [4/5]

template<typename T, typename E = std::error_code>
template<typename E2>
friend auto operator!= ( expected< T, E > const & lhs,
unexpected< E2 > const & rhs ) -> bool
friend

Definition at line 620 of file expected.hpp.

◆ operator!= [5/5]

template<typename T, typename E = std::error_code>
template<typename E2>
friend auto operator!= ( unexpected< E2 > const & lhs,
expected< T, E > const & rhs ) -> bool
friend

Definition at line 626 of file expected.hpp.

◆ operator== [1/5]

template<typename T, typename E = std::error_code>
template<typename T2, typename = std::enable_if_t<!std::is_same_v<expected, std::decay_t<T2>>>>
friend auto operator== ( const T2 & lhs,
expected< T, E > const & rhs ) -> bool
friend

Definition at line 590 of file expected.hpp.

◆ operator== [2/5]

template<typename T, typename E = std::error_code>
template<typename T2, typename = std::enable_if_t<!std::is_same_v<expected, std::decay_t<T2>>>>
friend auto operator== ( expected< T, E > const & lhs,
const T2 & rhs ) -> bool
friend

Definition at line 584 of file expected.hpp.

◆ operator== [3/5]

template<typename T, typename E = std::error_code>
template<typename T2, typename E2>
friend auto operator== ( expected< T, E > const & lhs,
expected< T2, E2 > const & rhs ) -> bool
friend

Definition at line 568 of file expected.hpp.

◆ operator== [4/5]

template<typename T, typename E = std::error_code>
template<typename E2>
friend auto operator== ( expected< T, E > const & lhs,
unexpected< E2 > const & rhs ) -> bool
friend

Definition at line 608 of file expected.hpp.

◆ operator== [5/5]

template<typename T, typename E = std::error_code>
template<typename E2>
friend auto operator== ( unexpected< E2 > const & lhs,
expected< T, E > const & rhs ) -> bool
friend

Definition at line 614 of file expected.hpp.


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