Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2008-03-12 13:02:17


on Wed Mar 12 2008, Max Motovilov <max-AT-motovilov.net> wrote:

>> In that case, then yes, it's been at least considered. The
>> _C++ Template Metaprogramming_ book has it as an exercise,
>> exercise 7-8 and calls it crossproduct_view.
>
> Note to self: read the book :-). The MPL learning curve is steep and
> every little bit should help.
>
>> A solution is posted here:
>>
>> http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?CPPTM_Answers_-_Exercise_7-8
>>
>> It would be interesting to compare the two solutions. The exercise just
>> specified 2 input sequences whereas your's allows (I guess)
>> any n>0 number of input sequences.
>
> No, they don't look similar. As far as I can tell from a one-minute
> look, the solution is simply a nested for_each loop and does not provide
> an actual sequence adapter, despite the name cross_product_view. Mine is
> a lazy view implemented using a sequence of iterator "digits".

If the original posting there isn't a true crossproduct view, I would be
very grateful if you'd replace it with your own solution.

Thanks and regards,

-- 
Dave Abrahams
Boost Consulting
http://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