We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 52bb9a3 commit a1eff1bCopy full SHA for a1eff1b
1 file changed
compact_optional.h
@@ -18,6 +18,13 @@ constexpr bool is_enum_value(std::underlying_type_t<T> enum_integral) {
18
}
19
return false;
20
21
+/*
22
+ A optional for enums that takes the same space as the underlying enum by
23
+ using an integer value that doesn't correspond to any enumerator to indicate
24
+ the "empty" state.
25
+
26
+ Requires c++14.
27
+ */
28
29
/*
30
Implementation note: this doesn't exactly implement the subset of the optional
0 commit comments