VCCC  2024.05
VisualCamp Common C++ library
unexpect.hpp
Go to the documentation of this file.
1 //
2 // Created by YongGyu Lee on 3/14/24.
3 //
4 
5 #ifndef VCCC_EXPECTED_UNEXPECT_HPP_
6 #define VCCC_EXPECTED_UNEXPECT_HPP_
7 
8 #if __cplusplus >= 202302L
9 
10 #include <expected>
11 
12 #else
13 
15 
16 #endif
17 
18 namespace vccc {
19 
22 
23 #if __cplusplus >= 202302L
24 
25 using unexpect_t = std::unexpect_t;
26 inline constexpr unexpect_t unexpect{};
27 
28 #else
29 
30 struct unexpect_t {
31  explicit unexpect_t() = default;
32 };
33 
35 
37 
38 #endif
39 
40 } // namespace vccc
41 
42 #endif // VCCC_EXPECTED_UNEXPECT_HPP_
constexpr VCCC_INLINE_OR_STATIC unexpect_t unexpect
Definition: unexpect.hpp:34
#define VCCC_INLINE_OR_STATIC
Definition: inline_or_static.hpp:9
Definition: directory.h:12
Definition: unexpect.hpp:30
unexpect_t()=default