Boost logo

Boost :

From: Eric Friedman (ebf_at_[hidden])
Date: 2003-11-04 01:24:15


David Abrahams wrote:

> Eric Friedman <ebf_at_[hidden]> writes:
>
>
>>>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.
>>
>>I think that may be a bit extreme. Type sequences seem to me a rather
>>unique exception...
>
> mpl::size<mpl::vector<int,long> >::type
> == mpl::size<int,long>::type
>
> ??
>
> You can't go around making exceptions in the type system lightly.

Well, I didn't say the convention would work both ways. But anyway,
after more thinking I see that the potential confusion resulting from my
approach may easily outweigh the convenience of pretty syntax.

The question now: what should we call variant< type-seq >?

>>>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.
>>
>>Wait, so does this mean you agree or disagree with me? I'm confused.
>
>
> I agree strongly that it's a useful capability and disagree strongly
> that it should happen without a special syntax (in this case "...").

Ah, I didn't realize that the ... is actually part of the syntax and not
just some way of conveying the semantics of the proposal.

I *definitely* would like to see something like this in C++0x.

Eric


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