Boost logo

Boost :

From: Joel de Guzman (joel_at_[hidden])
Date: 2006-08-06 22:02:38


Douglas Gregor wrote:
> On Aug 6, 2006, at 7:10 AM, Ion Gaztañaga wrote:
>> And what if Values parameter pack is instantiated as a sequence of the
>> same type? Should we make tuple<int, int> and array<int, 2> the
>> same type?
>
> They should be the same type, but there should be a common interface
> that allows one to act on both types in the same way. IIRC, array<>
> works with tuple_size, tuple_element, and get, so we already have
> that interface.

And Fusion regards boost::array as a fully conforming sequence.
All the facilities (algorithms, etc.) are available for array.
It is interesting to note that Dan (Marsden) did some tests and
found that fusion algorithms on boost::array with vc8.0 "significantly
outperforms the standard library equivalent code, presumably as
it has more information available at compile time, and with inlining
it effectively unrolls the entire loops".

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

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