mirror of
https://codeberg.org/DawnMagnet/reflect-cpp
synced 2026-12-04 01:06:19 +08:00
Actually use a tagged union
This commit is contained in:
@@ -28,7 +28,7 @@ void test_tagged_union() {
|
||||
rfl::Field<"width", double> width;
|
||||
};
|
||||
|
||||
using Shapes = std::variant<Circle, Square, Rectangle>;
|
||||
using Shapes = rfl::TaggedUnion<"shape", Circle, Square, Rectangle>;
|
||||
|
||||
const Shapes r = Rectangle{.height = 10, .width = 5};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user