Boost logo

Boost :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2002-07-02 11:21:03


On Tuesday 02 July 2002 10:24 am, David Abrahams wrote:
> From: "Martin Wille" <mw8329_at_[hidden]>
>
> > A variant basically is a union (be it typesafe or not). The process
> > of interpreting a unions value as of being of a specific type can be
> > referred to as putting a view onto it. So, view<>, view_as<> or even
> > as<> might be fitting names. Prefixing these with "variant_" might
> > make sense.
>
> My only problem with the "variant_" prefix is that we're talking about
> introducing a class template called variant, but also about making this a
> general-purpose function which applies to all kinds of different types. I
> think that's confusing at best.
>
> -Dave

That's reason enough for me. Let variant have its variant_cast, and use
another name for the general-purpose mechanism. 'extract' is fine by me: it's
close enough if we agree to all the subtyping mumbo-jumbo I just was babbling
on about, but still reasonable if/when the subtyping argument doesn't apply.

        Doug


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk