Sen API
Sen Libraries
Loading...
Searching...
No Matches
result.h File Reference
#include "sen/core/base/class_helpers.h"
#include <string_view>
#include <tuple>
#include <type_traits>
#include <variant>

Go to the source code of this file.

Classes

class  sen::Result< T, E >
 Result<T, E> is a template type that can be used to return and propagate errors. The intent is to replace exceptions in this context. Result<T, E> is an algebraic data type of Ok(T) that represents success and Err(E) representing an error. More...
class  sen::Result< void, E >
 Specialization for Results that just hold error data. More...
class  sen::Result< void, std::monostate >
 Specialization for Results that just hold success indication. More...

Namespaces

namespace  sen

Typedefs

using sen::BoolResult = Result<void, std::monostate>
 True or false result.

Functions

template<typename T, typename CleanT = std::decay_t<T>>
impl::Ok< CleanT > sen::Ok (T &&val) noexcept
 Helper (syntactic sugar) to create Results that indicate success.
template<typename E, typename CleanE = std::decay_t<E>>
impl::Err< CleanE > sen::Err (E &&val) noexcept
 Helper (syntactic sugar) to create Results that indicate error.
impl::Ok< void > sen::Ok () noexcept
 If T is void, use the void specialization of Ok.
impl::Err< void > sen::Err () noexcept
 If E is void, use the void specialization of Err.