diff options
Diffstat (limited to 'vsproject/tu_test/main.cpp')
-rw-r--r-- | vsproject/tu_test/main.cpp | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/vsproject/tu_test/main.cpp b/vsproject/tu_test/main.cpp new file mode 100644 index 00000000..48f7a26c --- /dev/null +++ b/vsproject/tu_test/main.cpp @@ -0,0 +1,46 @@ + +#include "../../src/include/tagged_union.hpp" + +TAGGED_UNION_EX(TestTu, (), Foo, ( + (Foo, struct { + }), + (Bar, struct { + }), + (Baz, unsigned int) + ), + (), (), () + ); +TAGGED_UNION(TestTu2, Foo, + (Foo, struct { + }), + (Bar, struct { + }), + (Baz, unsigned int) + ); + +int main() +{ + TestTu tmp; + + tmp = TestTu(123); + + TestTu tmp2 = TestTu::make_Bar({}); + + TU_MATCHA( (tmp), (e), + (Foo, + ), + (Bar, + ), + (Baz, + ) + ) + + TU_MATCHA((tmp,tmp2), (e,e2), + (Foo, + ), + (Bar, + ), + (Baz, + ) + ) +} |