On 01/30/12 09:32, Larry Evans wrote:
On 01/23/12 02:03, Allan Nielsen wrote:
Cool thanks a lot
Best regards Allan W. Nielsen
On Sun, Jan 22, 2012 at 7:41 PM, Larry Evans
wrote: On 01/22/12 12:03, Larry Evans wrote: [snip]
The attached code uses variadic templates and code from:
http://svn.boost.org/svn/boost/sandbox/variadic_templates/boost/mpl/
and does what you want except, instead of mpl::pair, it produces an mpl::vector whose size is the number of mpl sequences on input.
OOPS, forgot outer_product_pack, which is attached.
You might also have a look at Abel Sinkovics metaprogramming library:
http://abel.web.elte.hu/mpllibs/metamonad/index.html
I, as yet, have no idea of how to do what you want with Abel's library; however, I'd guess it could be done. In particular, I know list comprehensions:
http://www.haskell.org/haskellwiki/List_comprehension
( which are, AFAICT, flattened outer products) can be done with monads which Abel's library supplies.
Maybe you could ask Abel how to do this with his library. I'd be interested in seeing that.
HTH.
-Larry In a private email to me, Abel said his metaprogramming library could do this. I've attached a copy of his email. I don't know if you can use it, but I just thought it was interesting and may give some other ideas of how to solve your problem.
-regards, Larry