Template Struct success

Struct Documentation

template<typename T = void>
struct success

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

Param T:

type which the success helper class should contain

cxx::expected<int, float> callMe() {
    //...
    return cxx::success<int>(55);
}

Public Functions

success(const T &t) noexcept

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

Parameters:

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

success(T &&t) noexcept

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

Parameters:

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

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

constructor which creates a success 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