mirror of
https://github.com/aantron/better-enums.git
synced 2025-12-06 08:46:42 +08:00
These return values of an optional type better_enums::optional<T>. This type is defined in the spirit of boost::optional<T> and std::optional<T>, but is easy to manipulate at compile time. Two additional macros BETTER_ENUMS_USE_OPTIONAL and BETTER_ENUMS_EXTRA_INCLUDE are honored, whose intent is for the user to be able to inject an alternative option type. However, there are currently no viable alternatives. boost::optional<T> does not play well with constexpr, and I failed to make the code compile with std::optional<T>. I did not try very hard. I intend to support std::optional<T> in the future. Perhaps it will be the default, when available. |
||
|---|---|---|
| .. | ||
| 1-basic.cc | ||
| 2-iterate.cc | ||
| 3-switch.cc | ||
| 4-constexpr.cc | ||
| 5-containers.cc | ||
| 6-traits.cc | ||
| 7-bitset.cc | ||
| 8-constexpr-iterate.cc | ||
| Makefile | ||