utils: Implement enum size computation

This commit is contained in:
kd-11
2026-03-15 19:55:55 +03:00
committed by kd-11
parent 7240cbfdab
commit dbb6c87a10
2 changed files with 29 additions and 0 deletions
+8
View File
@@ -30,6 +30,9 @@ namespace cfg
// Internal hack
std::vector<std::string> try_to_enum_list(decltype(&fmt_class_string<int>::format) func);
// Internal hack
size_t try_to_enum_size(decltype(&fmt_class_string<int>::format) func);
// Config tree entry type.
enum class type : unsigned
{
@@ -312,6 +315,11 @@ namespace cfg
{
return try_to_enum_list(&fmt_class_string<T>::format);
}
size_t size() const
{
return try_to_enum_size(&fmt_class_string<T>::format);
}
};
// Signed 32/64-bit integer entry with custom Min/Max range.