Pasha Bibko Util Library
Loading...
Searching...
No Matches
FunctionFail< Err_Ty > Struct Template Referencefinal

Class to create when a function fails. More...

#include <ReturnVal.h>

Collaboration diagram for FunctionFail< Err_Ty >:

Public Member Functions

 FunctionFail (Err_Ty _error)
 Constructor that copies an error and stores it.
 
template<typename... Args>
requires std::is_constructible_v<Err_Ty, Args...>
 FunctionFail (Args &&... args)
 Constructor that creates the error within the class.
 

Public Attributes

Err_Ty error
 The error that the function is returning.
 

Detailed Description

template<typename Err_Ty = DefaultError>
struct PashaBibko::Util::FunctionFail< Err_Ty >

Class to create when a function fails.

This class has no functionality and is just used to help distinguish between Function fails and success when using Util::ReturnVal.

Template Parameters
Err_TyThe type of the error (cannot be void).

Constructor & Destructor Documentation

◆ FunctionFail() [1/2]

template<typename Err_Ty = DefaultError>
FunctionFail ( Err_Ty  _error)
inlineexplicit

Constructor that copies an error and stores it.

◆ FunctionFail() [2/2]

template<typename Err_Ty = DefaultError>
template<typename... Args>
requires std::is_constructible_v<Err_Ty, Args...>
FunctionFail ( Args &&...  args)
inlineexplicit

Constructor that creates the error within the class.

Constructs the error object within the class instead of copying for higher performance, recommended for large error types. Will only show as a valid function if the parameters passed to the function can be used to construct the error type.

Parameters
argsThe arguments that will be used to create the error object.

Member Data Documentation

◆ error

template<typename Err_Ty = DefaultError>
Err_Ty error

The error that the function is returning.


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