MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::ResultLike Concept Reference

Represents a type that fulfills the "result" contract. More...

#include <traits.hpp>

Concept definition

template<typename T>
concept mtcore::ResultLike = requires(T &t, const T &c, typename T::ErrVal e) {
{ T::from_error(e) } -> std::same_as<T>;
{ t == c } -> std::same_as<bool>;
{ c != t } -> std::same_as<bool>;
{ c.is_error() } -> std::same_as<bool>;
{ c.is_success() } -> std::same_as<bool>;
{ c.error() } -> std::same_as<typename T::ErrVal>;
} && (impl::ResultVoid<T> || impl::ResultValue<T>)
Represents a type that fulfills the "result" contract.

Detailed Description

Represents a type that fulfills the "result" contract.

Definition at line 155 of file core/mtcore/traits.hpp.