All Unordered Pairs of Elements in a Range

H. S. Teoh via Digitalmars-d-learn digitalmars-d-learn at
Sat Dec 13 15:06:01 PST 2014

On Sat, Dec 13, 2014 at 10:24:50PM +0000, "Nordlöw" via Digitalmars-d-learn wrote:
> Is there a Phobos method/range for selecting all pairs out of a range
> without caring about the ordering within each pair?
> Example:
> [1,2,3] => [(1,2), (2,3), (3,1)]

Sounds like:


Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald Knuth

More information about the Digitalmars-d-learn mailing list