LibQuicR
quicr::Unexpected< E > Class Template Reference

Wrapper that explicitly marks a value as an error. More...

#include <expected.h>

Public Member Functions

 Unexpected (const Unexpected &other)=default
 Copies an error wrapper. More...
 
 Unexpected (Unexpected &&other)=default
 Moves an error wrapper. More...
 
template<typename T >
 Unexpected (T &&value)
 Constructs the error from a forwarded value. More...
 
template<typename... Args>
 Unexpected (Args &&... args)
 Constructs the error in place from arguments. More...
 
const E & error () const
 

Detailed Description

template<typename E>
class quicr::Unexpected< E >

Wrapper that explicitly marks a value as an error.

Template Parameters
EStored error type.

Constructor & Destructor Documentation

◆ Unexpected() [1/4]

template<typename E >
quicr::Unexpected< E >::Unexpected ( const Unexpected< E > &  other)
default

Copies an error wrapper.

Parameters
otherWrapper to copy.

◆ Unexpected() [2/4]

template<typename E >
quicr::Unexpected< E >::Unexpected ( Unexpected< E > &&  other)
default

Moves an error wrapper.

Parameters
otherWrapper to move.

◆ Unexpected() [3/4]

template<typename E >
template<typename T >
quicr::Unexpected< E >::Unexpected ( T &&  value)
inline

Constructs the error from a forwarded value.

Template Parameters
TSource type accepted by E.
Parameters
valueValue used to construct the error.

◆ Unexpected() [4/4]

template<typename E >
template<typename... Args>
quicr::Unexpected< E >::Unexpected ( Args &&...  args)
inline

Constructs the error in place from arguments.

Template Parameters
ArgsConstructor argument types for E.
Parameters
argsArguments forwarded to E.

Member Function Documentation

◆ error()

template<typename E >
const E& quicr::Unexpected< E >::error ( ) const
inline
Returns
A reference to the stored error, valid for the lifetime of this wrapper.

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