Build all combinations of strings
bearophile via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Jan 11 13:28:31 PST 2015
Nordlöw:
> Couldn't we do a first pass and check that if elements of T are
> distinct and if so set doCopy to false otherwise true?
The algorithm you have seen in Rosettacode doesn't care if and
what items of the input sequence are duplicated, it handles them
as they are all distinct. And them being distinct (or not
distinct) doesn't change the desire to use something like doCopy
to have dup-ped output arrays, so I don't understand what you are
trying to say.
The purpose of doCopy is similar of the difference between
File.byLine and File.byLineCopy (originally I suggested to give a
doCopy argiment to byLine too, for safety. Andrei said no. Later
experience has shown I was right and we have added byLineCopy,
but now the default line iteration is the non-copying one, that
is less safe).
Bye,
bearophile
More information about the Digitalmars-d-learn
mailing list