Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-11-03 18:42:33


Eric Friedman <ebf_at_[hidden]> writes:

> No offense, but I believe it is a *terrible* idea for any type to have
> the dual meanings of 'type sequence' and 'value type'. I've raised
> this before; see
> http://lists.boost.org/MailArchives/boost/msg46807.php.
>
> As always, please feel to tell me if/why I'm wrong.

I understand your argument, but I'm uneasy about the idea that certain
Concepts are ineligible for multiple-refinement. IOW: why are type
sequences special? They *can* be passed by value (at least all of the
one's I've seen can). It's not unusual to have values that convey
nothing other than type info (see the std iterator tags). I see no
reason you shouldn't be able to make a variant containing an mpl type
sequence.

My feeling is that the most-principled (if not most-convenient)
design for variant would change the current usage

   variant<some-mpl-type-sequence>

into

   variant<variant_types<some-mpl-type-sequence> >

and leave

   variant<some-mpl-type-sequence>

for the case where you actually want an instance of
some-mpl-type-sequence in the variant.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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