Re:Std::visit is everything wrong with modern C++ (2017)
by busrf on Saturday December 05, 2020 @11:18AM
(#25315619)
I actually think the last version, using a single lambda with constexpr ifs inside, looks completely reasonable.
But yeah the first time I had to use boost::variant (which is what the version in the standard library is based on) I thought the visitor was too much boilerplate. Things have gotten better since then, but many people are not even on C++17 yet ):
But yeah the first time I had to use boost::variant (which is what the version in the standard library is based on) I thought the visitor was too much boilerplate. Things have gotten better since then, but many people are not even on C++17 yet ):