Boost logo

Boost :

From: Hamish Mackenzie (boost_at_[hidden])
Date: 2001-11-28 11:03:13


On Wed, 2001-11-28 at 15:22, David Abrahams wrote:
> Nope. But I was thinking of a simple idiom which would help. We could make a
> simple metafunction which returns the underlying cons-list if type pass a
> type_list, or the identity otherwise. Top-level metafunctions which want to
> take advantage of specialization could pass their arguments through this
> normalizing function.

How about if the algorithms normalized their results using a template to
derived the type_list (or type_vector or whatever) from the from the
cons-list if the number of items was less or equal to MAX_TEMPLATE_ARGS
(otherwise it would return the cons-list).

If this was the case what could type_list do that type_vector can't?

I like the mpl::type_vector idea a lot it must be very fast in a lot of
cases.

> In any case, Vesa's point applies to full specialization just as to partial
> specialization. It's still a pattern match, and your pattern can /only/
> match type lists based on a particular underlying list node template.

True but it is a technique which a lot of us are familiar with and it
would be nice if it worked as expected.

Hamish


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