Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-02-26 11:37:13


Tobias Schwinger <tschwinger_at_[hidden]> writes:

> Tobias Schwinger wrote:
>> Hi,
>> What is the best way to convert the result of a mutating mpl
>> intrinsic metafunction (such as 'mpl::push_back', for example) to
>> numbered form ('vectorN<a1,a2,..>') ?

I was hoping Aleksey would answer, but he seems to have dropped off
the face of the earth (temporarily, I hope).

I am guessing that Aleksey would say "don't do that!" He has always
maintained that relying on sequence type identity was just wrong.

>> I tried using the type-member (which only works on some compilers -
>> not with GCC for example) and figure 'copy' could probably do the
>> trick (but is a quite complex operation) so there might be a better
>> recipe for this.
>> In a library I'm currently working on, I use a decorator pattern to
>> make
>
> [ This refers to: http://tinyurl.com/6c35p ]
>
>> a class model of a sequence it holds (i.e. give it a tag type member
>> and specialize *_impl with delegate semantics). After applying the
>> delegate metafunction I need the sequence in a form I can match with
>> partial specialization.

I don't know the details of your problem, so I can't say for sure, but
you might consider using partial specialization based on the
sequence's tag and/or size.

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