add documentation for new enumerator functionality

This commit is contained in:
stu
2024-03-01 19:19:48 +00:00
parent 617226cd1d
commit ec437c51f2
2 changed files with 38 additions and 2 deletions
+2 -2
View File
@@ -50,8 +50,8 @@ void test() {
});
write_and_read(mutable_circle, R"({"radius":2.0,"color":"green"})");
rfl::get_underlying_enumerators<Color>().apply([&](auto field) {
if constexpr (decltype(field)::name() == "blue") {
rfl::get_underlying_enumerators<Color>().apply([&](const auto& field) {
if (field.name() == "blue") {
mutable_circle.color = static_cast<Color>(field.value());
}
});