Pecunia 0.9.0-alpha.22
Library using the ISO-4217 currency standard & a fixed monetary unit size
Loading...
Searching...
No Matches
pecunia::Unexpected< ErrorType > Struct Template Reference

Represents an unexpected error value. More...

#include <Expected.hpp>

Collaboration diagram for pecunia::Unexpected< ErrorType >:

Public Member Functions

 Unexpected (ErrorType value)
 Full initialisation constructor.
 

Public Attributes

ErrorType value_
 

Detailed Description

template<typename ErrorType>
struct pecunia::Unexpected< ErrorType >

Represents an unexpected error value.

It encapsulates an error state when a computation or operation does not yield a valid value but instead produces an error. It is primarily used to signify and propagate error states in expected/optional-like patterns in an explicit and type-safe manner.

Template Parameters
ErrorTypeThe type used to represent the error value.

Constructor & Destructor Documentation

◆ Unexpected()

template<typename ErrorType >
pecunia::Unexpected< ErrorType >::Unexpected ( ErrorType value)
explicit

Full initialisation constructor.

Parameters
valueThe error value to encapsulate.

Member Data Documentation

◆ value_

template<typename ErrorType >
ErrorType pecunia::Unexpected< ErrorType >::value_

Represents the underlying error value for an operation that failed or holds an invalid state.