refactor enum_type api for working with dynamic values

This commit is contained in:
BlackMATov
2024-08-08 03:08:23 +07:00
parent 11bc1c23b7
commit f90e8af84b
10 changed files with 175 additions and 86 deletions

View File

@@ -60,8 +60,8 @@ TEST_CASE("meta/meta_examples/enum/usage") {
const meta::enum_type align_type = meta::resolve_type(e);
// converts the enumerator to its name
CHECK(align_type.value_to_name(e) == "center");
CHECK(align_type.value_to_evalue(e).get_name() == "center");
// ... and back again
CHECK(align_type.name_to_value("center").as<align>() == e);
CHECK(align_type.name_to_evalue("center").get_value().as<align>() == e);
}