Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::expected< void, E > Class Template Reference

Specialization of expected for void value type. More...

#include <ah-cpp-compat.H>

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

Public Types

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

Public Member Functions

constexpr expected () noexcept
 
template<class G >
constexpr expected (const unexpected< G > &u)
 
template<class G >
constexpr expected (unexpected< G > &&u)
 
template<class... Args>
constexpr expected (unexpect_t, Args &&...args)
 
 expected (const expected &o)
 
 expected (expected &&o) noexcept(std::is_nothrow_move_constructible_v< E >)
 
expected & operator= (const expected &o)
 
expected & operator= (expected &&o) noexcept(std::is_nothrow_move_constructible_v< E >)
 
 ~expected ()
 
constexpr bool has_value () const noexcept
 
constexpr operator bool () const noexcept
 
constexpr void value () const
 
constexpr const E & error () const &noexcept
 
constexpr E & error () &noexcept
 
template<class F >
auto and_then (F &&f) const
 
template<class F >
auto or_else (F &&f) const
 

Private Member Functions

void destroy () noexcept
 

Private Attributes

union Aleph::expected< void, E >:: { ... }  
 
bool has_
 

Detailed Description

template<class E>
class Aleph::expected< void, E >

Specialization of expected for void value type.

Models success/failure without carrying a value on success. Common pattern for operations that report errors but have no meaningful return value.

Template Parameters
Eerror type.

Definition at line 689 of file ah-cpp-compat.H.

Member Typedef Documentation

◆ error_type

template<class E >
using Aleph::expected< void, E >::error_type = E

Definition at line 705 of file ah-cpp-compat.H.

◆ unexpected_type

template<class E >
using Aleph::expected< void, E >::unexpected_type = unexpected<E>

Definition at line 706 of file ah-cpp-compat.H.

◆ value_type

template<class E >
using Aleph::expected< void, E >::value_type = void

Definition at line 704 of file ah-cpp-compat.H.

Constructor & Destructor Documentation

◆ expected() [1/6]

template<class E >
constexpr Aleph::expected< void, E >::expected ( )
inlineconstexprnoexcept

Definition at line 708 of file ah-cpp-compat.H.

◆ expected() [2/6]

template<class E >
template<class G >
constexpr Aleph::expected< void, E >::expected ( const unexpected< G > &  u)
inlineconstexpr

Definition at line 711 of file ah-cpp-compat.H.

◆ expected() [3/6]

template<class E >
template<class G >
constexpr Aleph::expected< void, E >::expected ( unexpected< G > &&  u)
inlineconstexpr

Definition at line 716 of file ah-cpp-compat.H.

◆ expected() [4/6]

template<class E >
template<class... Args>
constexpr Aleph::expected< void, E >::expected ( unexpect_t  ,
Args &&...  args 
)
inlineexplicitconstexpr

Definition at line 722 of file ah-cpp-compat.H.

◆ expected() [5/6]

template<class E >
Aleph::expected< void, E >::expected ( const expected< void, E > &  o)
inline

◆ expected() [6/6]

template<class E >
Aleph::expected< void, E >::expected ( expected< void, E > &&  o)
inlinenoexcept

◆ ~expected()

template<class E >
Aleph::expected< void, E >::~expected ( )
inline

Definition at line 767 of file ah-cpp-compat.H.

References Aleph::expected< T, E >::destroy().

Member Function Documentation

◆ and_then()

template<class E >
template<class F >
auto Aleph::expected< void, E >::and_then ( F &&  f) const
inline

◆ destroy()

template<class E >
void Aleph::expected< void, E >::destroy ( )
inlineprivatenoexcept

◆ error() [1/2]

template<class E >
constexpr E & Aleph::expected< void, E >::error ( ) &
inlineconstexprnoexcept

Definition at line 779 of file ah-cpp-compat.H.

References Aleph::expected< T, E >::err_.

◆ error() [2/2]

template<class E >
constexpr const E & Aleph::expected< void, E >::error ( ) const &
inlineconstexprnoexcept

Definition at line 778 of file ah-cpp-compat.H.

References Aleph::expected< T, E >::err_.

◆ has_value()

template<class E >
constexpr bool Aleph::expected< void, E >::has_value ( ) const
inlineconstexprnoexcept

Definition at line 769 of file ah-cpp-compat.H.

References Aleph::expected< T, E >::has_.

◆ operator bool()

template<class E >
constexpr Aleph::expected< void, E >::operator bool ( ) const
inlineexplicitconstexprnoexcept

Definition at line 770 of file ah-cpp-compat.H.

References Aleph::expected< T, E >::has_.

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ or_else()

template<class E >
template<class F >
auto Aleph::expected< void, E >::or_else ( F &&  f) const
inline

◆ value()

template<class E >
constexpr void Aleph::expected< void, E >::value ( ) const
inlineconstexpr

Member Data Documentation

◆ []

union Aleph::expected< void, E > { ... } Aleph::expected< void, E >

◆ err_

template<class E >
E Aleph::expected< void, E >::err_

Definition at line 693 of file ah-cpp-compat.H.

◆ has_

template<class E >
bool Aleph::expected< void, E >::has_
private

Definition at line 695 of file ah-cpp-compat.H.


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