Zen C++ Libraries
Zero-dependency re-usable components for C++
Loading...
Searching...
No Matches
include
zen
error.hpp
1
#ifndef ZEN_ERROR_HPP
2
#define ZEN_ERROR_HPP
3
4
#include <variant>
5
6
#include "zen/config.hpp"
7
#include "
zen/either.hpp
"
8
9
ZEN_NAMESPACE_START
10
11
struct
unicode_invalid_surrogate_half
{
12
};
13
14
struct
unicode_invalid_byte_sequence
{
15
};
16
17
struct
unicode_unexpected_eof
{
18
};
19
20
struct
reached_end_of_stream
{
21
};
22
23
using
error = std::variant<
24
unicode_unexpected_eof
,
25
unicode_invalid_surrogate_half
,
26
unicode_invalid_byte_sequence
,
27
reached_end_of_stream
28
>;
29
30
template
<
typename
T>
31
using
result =
either<error, T>
;
32
33
ZEN_NAMESPACE_END
34
35
#endif
// #ifndef ZEN_ERROR_HPP
36
either
A type for computations that may fail.
Definition
either.hpp:124
either.hpp
Encapsulation for computations that may fail.
reached_end_of_stream
Definition
error.hpp:20
unicode_invalid_byte_sequence
Definition
error.hpp:14
unicode_invalid_surrogate_half
Definition
error.hpp:11
unicode_unexpected_eof
Definition
error.hpp:17
Generated by
1.15.0