std.jgrandson
Johannes Pfau via Digitalmars-d
digitalmars-d at puremagic.com
Sun Aug 3 11:08:34 PDT 2014
Am Sun, 03 Aug 2014 09:17:57 -0700
schrieb Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org>:
> On 8/3/14, 8:51 AM, Johannes Pfau wrote:
> >
> > Variant uses TypeInfo internally, right?
>
> No.
>
https://github.com/D-Programming-Language/phobos/blob/master/std/variant.d#L210
https://github.com/D-Programming-Language/phobos/blob/master/std/variant.d#L371
https://github.com/D-Programming-Language/phobos/blob/master/std/variant.d#L696
Also the handler function concept will always have more overhead than a
simple tagged union. It is certainly useful if you want to store any
type, but if you only want a limited set of types there are more
efficient implementations.
More information about the Digitalmars-d
mailing list