|
Boost : |
From: Max Motovilov (max_at_[hidden])
Date: 2008-03-11 23:42:45
I apologize in advance if something along these lines is already
available; however current public documentation doesn't mention such a
facility and a brief glance into SVN did not reveal one either...
product_view
Description: provides a view of a Cartesian product of multiple
sequences. Modeled after zip_view in that it expects a sequence [of
length n] of sequences S1...Sn as its argument and lazily generates a
sequence [of length Prod{1...n}( size< Si > )] of sequences
S1[1]...Sn[1] through S1[n]...Sn[n]. Whew... I know I can write better
documentation than that if I put my mind to it :(
I have attached a proof of concept implementation and a short test
program. The code appears to compile and work with MSVC 2003 & 2008 and
with GCC 4.2. It is not [yet] Boostified. My use case: I needed this
adapter to write a dynamic dispatcher for a known set of template
instances (poor man's dynamic template instantiation).
Regards,
...Max...
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk