help on cartesianProduct()
Era Scarecrow via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Dec 12 14:27:51 PST 2016
On Monday, 12 December 2016 at 14:27:07 UTC, Orut wrote:
> The code works beautifully! Thank you very much. Will certainly
> acknowledge you as source of this code if this becomes of part
> of a bigger project. I hope others searching this forum would
> also discover this code.
It could probably use some minor cleanup, documentation and
proper unittests and constraints, moving to unsigned size_t; If
front is used more than once than there's inefficiency with
memory and remaking the array it builds (among other things).
Could even make an opIndex for creating specific iterations of
the results.
But for it's simplicity I hope it does what you need. It really
wasn't that hard to make.
More information about the Digitalmars-d-learn
mailing list