Template Struct error

Struct Documentation

template<typename T>
struct error

helper struct to create an expected which is signalling an error more easily

Param T:

type which the success helper class should contain

cxx::expected<float> callMe() {
    //...
    return cxx::error<float>(12.34f);
}

Public Functions

error(const T &t) noexcept

constructor which creates a error helper class by copying the value of t

Parameters:

t[in] value which should be later stored in an expected

error(T &&t) noexcept

constructor which creates a error helper class by moving the value of t

Parameters:

t[in] value which should be later moved into an expected

template<typename ...Targs>
error(Targs&&... args) noexcept

constructor which creates a error helper class by forwarding arguments to the constructor of T

Parameters:

args...[in] arguments which will be perfectly forwarded to the constructor

Public Members

T value