We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 58fcb68 + bf62c23 commit be309f0Copy full SHA for be309f0
1 file changed
include/argparse/argparse.hpp
@@ -93,12 +93,19 @@ namespace argparse {
93
#pragma GCC diagnostic pop
94
#elif defined(_MSC_VER)
95
#pragma warning(pop)
96
+#endif
97
+#ifdef HAS_MAGIC_ENUM
98
+ } else if constexpr (std::is_enum<T>::value) {
99
+ for (const auto &[name, value] : magic_enum::enum_entries<T>()) {
100
+ if (v == name) {
101
+ return std::string{ value };
102
+ }
103
104
#endif
105
} else if constexpr (has_ostream_operator<T>::value) {
106
return static_cast<std::ostringstream &&>((std::ostringstream() << std::boolalpha << v)).str(); // https://github.com/stan-dev/math/issues/590#issuecomment-550122627
- } else {
- return "unknown";
107
}
108
+ return "unknown";
109
110
111
std::vector<std::string> inline split(const std::string &str) {
0 commit comments