initial matador ng commit

This commit is contained in:
2025-02-02 20:37:12 +01:00
parent 19de5714f4
commit ded3daceb3
378 changed files with 14913 additions and 13431 deletions
+4 -3
View File
@@ -11,7 +11,7 @@ template < typename EnumType, class Enable = void >
class enum_mapper;
template < typename EnumType>
class enum_mapper<EnumType, typename std::enable_if<std::is_enum<EnumType>::value>::type>
class enum_mapper<EnumType, std::enable_if_t<std::is_enum_v<EnumType>>>
{
public:
using enum_to_string_map = std::unordered_map<EnumType, std::string>;
@@ -33,17 +33,18 @@ public:
return std::nullopt;
}
std::string to_string(EnumType enum_value) const {
const std::string& to_string(EnumType enum_value) const {
if (const auto it = enum_to_string_map_.find(enum_value); it != enum_to_string_map_.end()) {
return it->second;
}
return {};
return empty_;
}
private:
enum_to_string_map enum_to_string_map_;
string_to_enum_map string_to_enum_map_;
std::string empty_{};
};
}