Why doesn't std.variant.visit automatically call the provided delegates?
Nemanja Boric via Digitalmars-d
digitalmars-d at puremagic.com
Mon Nov 7 01:42:50 PST 2016
On Saturday, 5 November 2016 at 20:15:14 UTC, Kapps wrote:
>
> That's really confusing. I've used D for quite a while, and
> didn't know that. Admittedly I doubt I've ever tried () => { },
> but given languages like C# which this syntax was partially
> taken from(?), that behaviour is very unexpected. That feels
> like it should be a compiler warning.
I was just going to say that after a weekend my mind on this is
that this behavior is no different than C's:
if (x = 5) { }
issue. It deserves at least warning (if you make a delegate that
returns delegate that can't be called).
More information about the Digitalmars-d
mailing list