MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::Error< Underlying > Struct Template Reference

A struct representing an error Auto convertible to a Result of any type. More...

#include <result.hpp>

Inheritance diagram for mtcore::Error< Underlying >:

Public Types

using Type = Underlying
 

Public Member Functions

template<typename T>
 operator Result< T, Underlying > () const noexcept
 Casts to a Result type (meant to be implicit)
 
bool operator== (const Error &o) const noexcept
 Compares error codes.
 
bool operator!= (const Error &o) const noexcept
 

Public Attributes

Underlying code
 

Detailed Description

template<typename Underlying>
struct mtcore::Error< Underlying >

A struct representing an error Auto convertible to a Result of any type.

Represents a result error (create with the error() method) Auto castable to Result.

Template Parameters
UnderlyingUnderlying error code type

Definition at line 62 of file result.hpp.

Member Typedef Documentation

◆ Type

template<typename Underlying>
using mtcore::Error< Underlying >::Type = Underlying

Definition at line 63 of file result.hpp.

Member Function Documentation

◆ operator Result< T, Underlying >()

template<typename Underlying>
template<typename T>
mtcore::Error< Underlying >::operator Result< T, Underlying > ( ) const
noexcept

Casts to a Result type (meant to be implicit)

Template Parameters
TResult type to cast to
Returns
Result type

Definition at line 413 of file result.hpp.

413 {
415 }
static Result from_error(const ErrVal &err)
Creates a Result object from an error.
Definition result.hpp:200
Here is the call graph for this function:

◆ operator!=()

template<typename Underlying>
bool mtcore::Error< Underlying >::operator!= ( const Error< Underlying > & o) const
inlinenoexcept

Definition at line 80 of file result.hpp.

80{ return code != o.code; }
A struct representing an error Auto convertible to a Result of any type.
Definition result.hpp:62
Underlying code
Definition result.hpp:64

◆ operator==()

template<typename Underlying>
bool mtcore::Error< Underlying >::operator== ( const Error< Underlying > & o) const
inlinenoexcept

Compares error codes.

Parameters
oOther error
Returns
true if codes are the same

Definition at line 79 of file result.hpp.

79{ return code == o.code; }

Member Data Documentation

◆ code

template<typename Underlying>
Underlying mtcore::Error< Underlying >::code

Definition at line 64 of file result.hpp.


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