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 123 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 127 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 128 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 126 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 132 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 140 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 148 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 165 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 175 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 182 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 187 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 192 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 198 of file expected.hpp.

◆ ~expected()

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

Definition at line 268 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 413 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 431 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 422 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 440 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 379 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 360 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 350 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 355 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 345 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 312 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 307 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 302 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 292 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 297 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 287 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 277 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 282 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 213 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 204 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 225 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 254 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 240 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 449 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 467 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 458 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 476 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 387 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 485 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 503 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 494 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 512 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 521 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 539 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 530 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 548 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 338 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 324 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 331 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 317 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 372 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 366 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 592 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 586 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 610 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 616 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 580 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 574 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 558 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 598 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 604 of file expected.hpp.


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