== Quote from Andrei Alexandrescu > Yah, per your follow-up post, it's a different problem. It's also a much > more difficult one. I convinced myself crossProduct is impossible to > implement if one input range and one infinite forward range are > simultaneously present. It works with any number of infinite forward > ranges, and also with other combinations. I couldn't formalize the exact > requirements yet.
I must be missing something, because I don't understand how you could possibly take the cross product of any number of infinite ranges (other than to just return the range of (a[0], b[i]) for all (infinitely many) i in b). Note that I'm assuming you mean cartesian product, rather than cross product; I've never heard cross product used in the context of sets.