On 18 November 2014 15:02, Matt Calabrese
For a while I assumed exactly that, but he actually specifically voiced that he does not like visitation on variant and thinks of it as a hack. It's sad :/
FWIW: I think he is (a) correct, but (b) we have nothing better to replace it, so we still need it.
We should really start a thread about this. I'm very curious to see an actual objective rationale both for why visitation over a closed set of types known at compile time is in any way a "hack,"
It's the inversion of control that people just don't like.
along with a realistic alternative.
As I already said, I don't know of one, and having it is better than not having it. The discussion in Urbana on n4218 http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4218.pdf (variant), which didn't propose visitation, basically amounted to we don't like visitation but we need it unless something better comes along.
It really is a fundamental operation of a discriminated union. As someone who uses variants pretty much as the "default" for run-time polymorphism in day-to-day coding, I have never seen an actual explanation for what someone might consider bad about variant visitation, neither from Bjarne nor anyone else.
While I don't want to speak for Bjarne, I believe he would rather have some form of Pattern Matching http://www.stroustrup.com/OpenPatternMatching.pdf and possibly variant as a language feature. That being said, no one has proposed it. -- Nevin ":-)" Liber mailto:nevin@eviloverlord.com (847) 691-1404