Sese Framework  2.3.0
A cross-platform framework
Loading...
Searching...
No Matches
sese::Result< T, void > Class Template Reference

#include <Result.h>

Public Types

using ResultType = T
 
using ErrorType = void
 

Public Member Functions

 operator bool () const noexcept
 Whether it is an error.
 
bool has_error () const noexcept
 Whether it is an error.
 
T & get () noexcept
 Get the result.
 
get () const noexcept
 Get the result.
 

Static Public Member Functions

static Result error () noexcept
 
static Result success (T result) noexcept
 

Private Member Functions

 Result ()=default
 

Private Attributes

std::optional< T > result
 

Member Typedef Documentation

◆ ErrorType

template<class T >
using sese::Result< T, void >::ErrorType = void

◆ ResultType

template<class T >
using sese::Result< T, void >::ResultType = T

Constructor & Destructor Documentation

◆ Result()

template<class T >
sese::Result< T, void >::Result ( )
privatedefault

Member Function Documentation

◆ error()

template<class T >
static Result sese::Result< T, void >::error ( )
inlinestaticnoexcept

◆ get() [1/2]

template<class T >
T sese::Result< T, void >::get ( ) const
inlinenoexcept

Get the result.

Returns
The result

◆ get() [2/2]

template<class T >
T & sese::Result< T, void >::get ( )
inlinenoexcept

Get the result.

Returns
The result

◆ has_error()

template<class T >
bool sese::Result< T, void >::has_error ( ) const
inlinenoexcept

Whether it is an error.

Return values
turehas error

◆ operator bool()

template<class T >
sese::Result< T, void >::operator bool ( ) const
inlineexplicitnoexcept

Whether it is an error.

Return values
turehas error

◆ success()

template<class T >
static Result sese::Result< T, void >::success ( T result)
inlinestaticnoexcept

Member Data Documentation

◆ result

template<class T >
std::optional<T> sese::Result< T, void >::result
private

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