rfl::UnderlyingEnums (#186)

* First part

* Plural

* Update rfl.hpp

* Documentation

* Update rfl.hpp

* Update processors.md

* underlying_enums test

* Update Parser_default.hpp

* Fix typo in test
This commit is contained in:
AnsiV01
2024-09-12 09:37:31 +02:00
committed by GitHub
parent 7274a2eb47
commit dfc24ad932
7 changed files with 124 additions and 7 deletions
+25
View File
@@ -0,0 +1,25 @@
#include <cassert>
#include <iostream>
#include <rfl.hpp>
#include <rfl/json.hpp>
#include <string>
#include <vector>
#include "write_and_read.hpp"
namespace test_underlying_enums {
enum class Color { red, green, blue, yellow };
struct Circle {
float radius;
Color color;
};
TEST(json, test_underlying_enums) {
const auto circle = Circle{.radius = 2.0, .color = Color::green};
write_and_read<rfl::UnderlyingEnums>(circle, R"({"radius":2.0,"color":1})");
}
} // namespace test_enum1