Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
arene::base::error_result_t< ErrorType > Class Template Reference

Intermediary type for constructing a result with a given error_type . More...

Public Member Functions

template<typename... ArgTypes, constraints< std::enable_if_t< all_of_v<!std::is_same< remove_cvref_t< ArgTypes >, error_result_t >::value... > > > = nullptr>
constexpr error_result_t (ArgTypes &&... args) noexcept(std::is_nothrow_constructible< ErrorType, ArgTypes... >::value)
 Construct the stored error from the specified arguments.
 
constexpr error_result_t (error_result_t &&)=default
 Move constructor.
 
constexpr error_result_t (error_result_t const &)=default
 Copy constructor.
 
 ~error_result_t ()=default
 destructor
 
template<typename Value>
constexpr operator result< Value, ErrorType > () &&noexcept(noexcept(result< Value, ErrorType >(in_place_error, std::declval< ErrorType && >())))
 Instantiates a result<Value,ErrorType> from the contained error instance, moving the error value into the result.
 
template<typename Value>
constexpr operator result< Value, ErrorType > () const &noexcept(noexcept(result< Value, ErrorType >(in_place_error, std::declval< ErrorType const & >())))
 Instantiates a result<Value,ErrorType> from the contained error instance.
 
constexpr auto operator= (error_result_t &&) -> error_result_t &=default
 Move constructor.
 
constexpr auto operator= (error_result_t const &) -> error_result_t &=default
 Copy assignment.
 

Detailed Description

template<typename ErrorType>
class arene::base::error_result_t< ErrorType >

Intermediary type for constructing a result with a given error_type .

Note
Generally this should not be constructed manually; it intended as a transient type that allow to construct a result Object while using type deduction for value_type and error_type .
Template Parameters
ErrorTypethe error_type of a result constructed from this type.
See also
arene::base::error_result for the factory function that should be used in user code.

Constructor & Destructor Documentation

◆ error_result_t() [1/3]

template<typename ErrorType>
template<typename... ArgTypes, constraints< std::enable_if_t< all_of_v<!std::is_same< remove_cvref_t< ArgTypes >, error_result_t >::value... > > > = nullptr>
arene::base::error_result_t< ErrorType >::error_result_t ( ArgTypes &&... args)
inlineconstexprnoexcept

Construct the stored error from the specified arguments.

Template Parameters
ArgTypesthe types of the arguments
Parameters
argsThe arguments

◆ error_result_t() [2/3]

template<typename ErrorType>
arene::base::error_result_t< ErrorType >::error_result_t ( error_result_t< ErrorType > const & )
constexprdefault

Copy constructor.

◆ error_result_t() [3/3]

template<typename ErrorType>
arene::base::error_result_t< ErrorType >::error_result_t ( error_result_t< ErrorType > && )
constexprdefault

Move constructor.

◆ ~error_result_t()

template<typename ErrorType>
arene::base::error_result_t< ErrorType >::~error_result_t ( )
default

destructor

Member Function Documentation

◆ operator result< Value, ErrorType >() [1/2]

template<typename ErrorType>
template<typename Value>
arene::base::error_result_t< ErrorType >::operator result< Value, ErrorType > ( ) &&
inlineconstexprnoexcept

Instantiates a result<Value,ErrorType> from the contained error instance, moving the error value into the result.

Template Parameters
Valuethe value_type of the produced result .

◆ operator result< Value, ErrorType >() [2/2]

template<typename ErrorType>
template<typename Value>
arene::base::error_result_t< ErrorType >::operator result< Value, ErrorType > ( ) const &
inlineconstexprnoexcept

Instantiates a result<Value,ErrorType> from the contained error instance.

Template Parameters
Valuethe value_type of the produced result .

◆ operator=() [1/2]

template<typename ErrorType>
auto arene::base::error_result_t< ErrorType >::operator= ( error_result_t< ErrorType > && ) -> error_result_t &=default
constexprdefault

Move constructor.

◆ operator=() [2/2]

template<typename ErrorType>
auto arene::base::error_result_t< ErrorType >::operator= ( error_result_t< ErrorType > const & ) -> error_result_t &=default
constexprdefault

Copy assignment.


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