TachyonUI 0.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
tachyon::Result< void > Class Reference

Success, or the Error saying why not. More...

#include <gui_core/gui_result.h>

Public Member Functions

bool HasValue () const
 True on success; same as the bool conversion.
 operator bool () const
const Error & GetError () const
 The error; a default Error on success.
void ValueOr (void fallback) const
 A copy of the value, or fallback when there is none.
 Result ()=default
 Default-constructed is success; implicit from an Error for failure.
 Result (Error error)
 Default-constructed is success; implicit from an Error for failure.
void & Value ()
 The value; only valid when HasValue() (std::get throws otherwise).
void & operator* ()
 The value; only valid when HasValue() (std::get throws otherwise).
void * operator-> ()
 The value; only valid when HasValue() (std::get throws otherwise).

Detailed Description

Success, or the Error saying why not.

Constructor & Destructor Documentation

◆ Result() [1/2]

tachyon::Result< void >::Result ( )
default

Default-constructed is success; implicit from an Error for failure.

◆ Result() [2/2]

tachyon::Result< void >::Result ( Error error)
inline

Default-constructed is success; implicit from an Error for failure.

Member Function Documentation

◆ HasValue()

bool tachyon::Result< void >::HasValue ( ) const
inline

True on success; same as the bool conversion.

◆ operator bool()

tachyon::Result< void >::operator bool ( ) const
inlineexplicit

◆ GetError()

const Error & tachyon::Result< void >::GetError ( ) const
inline

The error; a default Error on success.

◆ Value()

void & tachyon::Result< void >::Value ( )
inline

The value; only valid when HasValue() (std::get throws otherwise).

  • and -> do the same.

◆ operator*()

void & tachyon::Result< void >::operator* ( )
inline

The value; only valid when HasValue() (std::get throws otherwise).

  • and -> do the same.

◆ operator->()

void * tachyon::Result< void >::operator-> ( )
inline

The value; only valid when HasValue() (std::get throws otherwise).

  • and -> do the same.

◆ ValueOr()

void tachyon::Result< void >::ValueOr ( void fallback) const
inline

A copy of the value, or fallback when there is none.


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