News for hackers. Stuff that matters.
Re:Std::visit is everything wrong with modern C++ by ezyang on Thursday September 14, 2017 @03:51PM (#15251899)
You don't get exhaustiveness checking, which is the killer feature of variants.
Re:Std::visit is everything wrong with modern C++ by joe_loser on Thursday September 14, 2017 @09:54PM (#15253992)
Yeah, plus the if branches are runtime-checks instead of the if-constexpr approach
Re:Std::visit is everything wrong with modern C++ by gpderetta on Friday September 15, 2017 @05:02AM (#15255658)
There is about the same amount of runtime checks. In the auto-lambda+constexpr case the switch/if-cascade is inside visit and it is required to dispatch the correct type to the visitor.