🤔 Ah yes, the "Variadic Switch", because what else could be more thrilling than unearthing the mysteries of C++ template wizardry via a 21-minute Reddit-inspired pontification? 🎩✨ Who needs actual code when you can have imaginary syntax to dazzle your imaginary friends! 🙄🔮
https://pydong.org/posts/variadic-switch/ #VariadicSwitch #C++Templates #RedditDiscussion #CodeMysteries #ProgrammingHumor #HackerNews #ngated
Variadic Switch

Several years back I found an interesting question on Reddit. Essentially the author asks why there is no way to expand a pack into a sequence of case labels followed by a statement. It was illustrated with the following imaginary syntax: ```c++ template <class Visitor, class Variant, std::size_t … Is> auto visit_impl(Visitor visitor, Variant && variant, std::index_sequence) { auto i = variant.index(); switch (i) { (case Is: return visitor(get(variant));)... } }

Pydong