ThreadSchedule 1.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::expected< void, E > Class Template Reference

Specialization of expected for operations that produce no value. More...

#include <expected.hpp>

Inheritance diagram for threadschedule::expected< void, E >:
[legend]
Collaboration diagram for threadschedule::expected< void, E >:
[legend]

Public Types

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

Public Member Functions

constexpr expected (expected const &other)=default
constexpr expected (expected &&other)=default
template<typename... Args>
constexpr expected (unexpect_t, Args &&... args)
constexpr expected (unexpected< E > const &ue)
constexpr expected (unexpected< E > &&ue)
constexpr auto operator= (expected const &other) -> expected &=default
constexpr auto operator= (expected &&other) -> expected &=default
constexpr auto operator= (unexpected< E > const &ue) -> expected &
constexpr auto operator= (unexpected< E > &&ue) -> expected &
constexpr operator bool () const noexcept
constexpr auto has_value () const noexcept -> bool
constexpr void value () const
constexpr auto error () const &noexcept -> E const &
constexpr auto error () &noexcept -> E &
constexpr auto error () const &&noexcept -> E const &&
constexpr auto error () &&noexcept -> E &&
constexpr void emplace ()
constexpr void swap (expected &other) noexcept(std::is_nothrow_move_constructible_v< E > &&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 &&
constexpr auto operator-> () const noexcept -> void const *
constexpr auto operator* () const &noexcept -> void const &
constexpr auto value_or (U &&default_value) const &-> void

Friends

template<typename E2>
constexpr friend auto operator== (expected const &lhs, expected< void, E2 > const &rhs) -> bool
template<typename E2>
constexpr friend auto operator!= (expected const &lhs, expected< void, E2 > 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 E>
class threadschedule::expected< void, E >

Specialization of expected for operations that produce no value.

expected<void, E> can be in either a "success" state (has_value() is true, no payload) or an "error" state carrying an E. This is useful for functions that can fail but have nothing to return on success.

Template Parameters
EThe error type. Defaults to std::error_code in the primary template; here it is explicitly specified by the user.
See also
expected<T, E>

Definition at line 735 of file expected.hpp.

Member Typedef Documentation

◆ error_type

template<typename E>
using threadschedule::expected< void, E >::error_type = E

Definition at line 739 of file expected.hpp.

◆ unexpected_type

template<typename E>
using threadschedule::expected< void, E >::unexpected_type = unexpected<E>

Definition at line 740 of file expected.hpp.

◆ value_type

template<typename E>
using threadschedule::expected< void, E >::value_type = void

Definition at line 738 of file expected.hpp.

Constructor & Destructor Documentation

◆ expected() [1/4]

template<typename E>
threadschedule::expected< void, E >::expected ( )
inlineconstexpr

Definition at line 742 of file expected.hpp.

◆ expected() [2/4]

template<typename E>
template<typename... Args>
threadschedule::expected< void, E >::expected ( unexpect_t ,
Args &&... args )
inlineexplicitconstexpr

Definition at line 750 of file expected.hpp.

◆ expected() [3/4]

template<typename E>
threadschedule::expected< void, E >::expected ( unexpected< E > const & ue)
inlineconstexpr

Definition at line 755 of file expected.hpp.

◆ expected() [4/4]

template<typename E>
threadschedule::expected< void, E >::expected ( unexpected< E > && ue)
inlineconstexpr

Definition at line 759 of file expected.hpp.

◆ ~expected()

threadschedule::expected< void, E >::~expected ( )
inline

Definition at line 359 of file expected.hpp.

Member Function Documentation

◆ and_then() [1/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::and_then ( F && f) &
inlineconstexpr

Definition at line 842 of file expected.hpp.

◆ and_then() [2/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::and_then ( F && f) &&
inlineconstexpr

Definition at line 860 of file expected.hpp.

◆ and_then() [3/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::and_then ( F && f) const &
inlineconstexpr

Definition at line 851 of file expected.hpp.

◆ and_then() [4/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::and_then ( F && f) const &&
inlineconstexpr

Definition at line 869 of file expected.hpp.

◆ emplace()

template<typename E>
void threadschedule::expected< void, E >::emplace ( )
inlineconstexpr

Definition at line 816 of file expected.hpp.

◆ error() [1/4]

template<typename E>
auto threadschedule::expected< void, E >::error ( ) && -> E&&
inlineconstexprnoexcept

Definition at line 811 of file expected.hpp.

◆ error() [2/4]

template<typename E>
auto threadschedule::expected< void, E >::error ( ) & -> E&
inlineconstexprnoexcept

Definition at line 801 of file expected.hpp.

◆ error() [3/4]

template<typename E>
auto threadschedule::expected< void, E >::error ( ) const && -> E const&&
inlinenodiscardconstexprnoexcept

Definition at line 806 of file expected.hpp.

◆ error() [4/4]

template<typename E>
auto threadschedule::expected< void, E >::error ( ) const & -> E const&
inlinenodiscardconstexprnoexcept

Definition at line 796 of file expected.hpp.

◆ has_value()

template<typename E>
auto threadschedule::expected< void, E >::has_value ( ) const -> bool
inlinenodiscardconstexprnoexcept

Definition at line 785 of file expected.hpp.

◆ operator bool()

template<typename E>
threadschedule::expected< void, E >::operator bool ( ) const
inlineexplicitconstexprnoexcept

Definition at line 780 of file expected.hpp.

◆ operator*()

auto threadschedule::expected< void, E >::operator* ( ) const & -> T const&
inlineconstexprnoexcept

Definition at line 378 of file expected.hpp.

◆ operator->()

auto threadschedule::expected< void, E >::operator-> ( ) const -> T const*
inlineconstexprnoexcept

Definition at line 368 of file expected.hpp.

◆ operator=() [1/2]

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

Definition at line 773 of file expected.hpp.

◆ operator=() [2/2]

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

Definition at line 766 of file expected.hpp.

◆ or_else() [1/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::or_else ( F && f) &
inlineconstexpr

Definition at line 878 of file expected.hpp.

◆ or_else() [2/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::or_else ( F && f) &&
inlineconstexpr

Definition at line 896 of file expected.hpp.

◆ or_else() [3/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::or_else ( F && f) const &
inlineconstexpr

Definition at line 887 of file expected.hpp.

◆ or_else() [4/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::or_else ( F && f) const &&
inlineconstexpr

Definition at line 905 of file expected.hpp.

◆ swap()

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

Definition at line 821 of file expected.hpp.

◆ transform() [1/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::transform ( F && f) &
inlineconstexpr

Definition at line 914 of file expected.hpp.

◆ transform() [2/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::transform ( F && f) &&
inlineconstexpr

Definition at line 932 of file expected.hpp.

◆ transform() [3/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::transform ( F && f) const &
inlineconstexpr

Definition at line 923 of file expected.hpp.

◆ transform() [4/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::transform ( F && f) const &&
inlineconstexpr

Definition at line 941 of file expected.hpp.

◆ transform_error() [1/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::transform_error ( F && f) &
inlineconstexpr

Definition at line 950 of file expected.hpp.

◆ transform_error() [2/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::transform_error ( F && f) &&
inlineconstexpr

Definition at line 968 of file expected.hpp.

◆ transform_error() [3/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::transform_error ( F && f) const &
inlineconstexpr

Definition at line 959 of file expected.hpp.

◆ transform_error() [4/4]

template<typename E>
template<typename F>
auto threadschedule::expected< void, E >::transform_error ( F && f) const &&
inlineconstexpr

Definition at line 977 of file expected.hpp.

◆ value()

template<typename E>
void threadschedule::expected< void, E >::value ( ) const
inlineconstexpr

Definition at line 790 of file expected.hpp.

◆ value_or()

auto threadschedule::expected< void, E >::value_or ( U && default_value) const &-> void
inlineconstexpr

Definition at line 457 of file expected.hpp.

◆ operator!= [1/3]

template<typename E>
template<typename E2>
friend auto operator!= ( expected< void, E > const & lhs,
expected< void, E2 > const & rhs ) -> bool
friend

Definition at line 997 of file expected.hpp.

◆ operator!= [2/3]

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

Definition at line 1015 of file expected.hpp.

◆ operator!= [3/3]

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

Definition at line 1021 of file expected.hpp.

◆ operator== [1/3]

template<typename E>
template<typename E2>
friend auto operator== ( expected< void, E > const & lhs,
expected< void, E2 > const & rhs ) -> bool
friend

Definition at line 987 of file expected.hpp.

◆ operator== [2/3]

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

Definition at line 1003 of file expected.hpp.

◆ operator== [3/3]

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

Definition at line 1009 of file expected.hpp.


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