diff options
author | John Hodge <tpg@mutabah.net> | 2018-12-22 20:38:08 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2018-12-22 20:38:08 +0800 |
commit | 52cd5e2947f634df8bfa7da89ee33eee82134ff7 (patch) | |
tree | ecef3a119209ad67b42567c86ba0c19875e892b9 /src | |
parent | 883cf34da3e273cd3878026d855b9579055c09c0 (diff) | |
download | mrust-52cd5e2947f634df8bfa7da89ee33eee82134ff7.tar.gz |
tagged_union - Fix TU_ARM not using parens around the value
Diffstat (limited to 'src')
-rw-r--r-- | src/include/tagged_union.hpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/tagged_union.hpp b/src/include/tagged_union.hpp index 93dc6980..12e39fc8 100644 --- a/src/include/tagged_union.hpp +++ b/src/include/tagged_union.hpp @@ -120,7 +120,7 @@ #define TU_MATCH_HDR_(CLASS, VARS, brace) switch( (TU_FIRST VARS).tag() ) brace case CLASS::TAGDEAD: assert(!"ERROR: destructed tagged union used"); // Evil hack: two for loops, the inner stops the outer after it's done. -#define TU_ARM(VAR, TAG, NAME) break; case ::std::remove_reference<decltype(VAR)>::type::TAG_##TAG: for(bool tu_lc = true; tu_lc; tu_lc=false) for(auto& NAME = VAR.as_##TAG(); (void)NAME, tu_lc; tu_lc=false) +#define TU_ARM(VAR, TAG, NAME) break; case ::std::remove_reference<decltype(VAR)>::type::TAG_##TAG: for(bool tu_lc = true; tu_lc; tu_lc=false) for(auto& NAME = (VAR).as_##TAG(); (void)NAME, tu_lc; tu_lc=false) //#define TU_TEST(VAL, ...) (VAL.is_##TAG() && VAL.as_##TAG() TEST) #define TU_TEST1(VAL, TAG1, TEST) (VAL.is_##TAG1() && VAL.as_##TAG1() TEST) |