Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-11-03 19:28:14


Eric Friedman <ebf_at_[hidden]> writes:

> I think the benefits of the variant< type-seq > syntax as equivalent
> to variant< type-seq[0], type-seq[1], ... > far outweigh the benefits
> of making variant directly store what should in my opinion be an empty
> type.
>
> IMO, all templates with 'variadic' template parameter lists should
> adopt this F< type-seq > == F< type-seq[0], type-seq[1], ... >
> convention.

Interesting idea. But in the end, types should be types should be
types. I don't want types with special properties having unique
behavior when used as template parameters. That would eventually
break all generic metaprogramming.

Consider the syntax currently being discussed by the committee for
doing the same sort of thing with tuple types at runtime:

      f(some-tuple...)
      == f(at<0>(some-tuple), at<1>(some-tuple), ... )

That would lead to:

     F<type-seq...>
     == F< type-seq[0], type-seq[1], ... >

I rather like that symmetry.

-- 
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