Comment
Comment by Rangi42
With C++17's compile-time conditionals, plus good old C preprocessor macros, you could do this:
(MATCH_VARIANT could be extended to allow capturing vairables, or just omit that macro, it saves less typing than CASE_VARIANT anyway.)