Infinity Engine v0.6.20
C++ API Documentation
Loading...
Searching...
No Matches
Expected.hpp
1// INFINITY_API_PUBLIC
2
3#pragma once
4
5#include <Infinity/api.h>
6#include <tl/expected.hpp>
7
9{
98 template<class T, class E>
99 using Expected = tl::expected<T, E>;
100
110 template<class E>
111 using Unexpected = tl::unexpected<E>;
112
132 template<class E>
134 {
135 return tl::make_unexpected<E>(std::forward<E>(e));
136 }
137}
Definition Expected.hpp:9
tl::unexpected< E > Unexpected
Represents an error value for Expected<T, E>.
Definition Expected.hpp:111
tl::expected< T, E > Expected
Type-safe error handling using the expected/unexpected pattern.
Definition Expected.hpp:99
auto make_unexpected(E &&e) -> Unexpected< typename std::decay< E >::type >
Constructs an Unexpected error value.
Definition Expected.hpp:133