I've looked through std.algorithm and std.range, but haven't found anything 
to compute the Cartesian product of several ranges. I have the nagging 
feeling that this can be accomplished by combining several of the range 
transformations in the standard library.

What I'm after is something like this:

alias Tuple!(int, string) P;
assert(equal( 
        cartesianProduct([1, 2], ["a", "b"]),
        [ P(1, "a"), P(1, "b"), P(2, "a"), P(2, "b") ]
));

Reply via email to