Subject: Re: [boost] [optional] Safe optional
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2014-11-18 16:02:24
On Tue, Nov 18, 2014 at 12:24 PM, Nevin Liber <nevin_at_[hidden]>
> On 18 November 2014 01:16, Matt Calabrese <rivorus_at_[hidden]> wrote:
> > On Mon, Nov 17, 2014 at 10:59 PM, Vicente J. Botet Escriba <
> > vicente.botet_at_[hidden]> wrote:
> > >
> > >> I will ad that I believe Dr BS don't like dynamic visitation, but
> > > we are doing pattern matching on types, isn't it?
> > 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," along with a realistic
alternative. 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.