Checking all elements are unique.

Rene Zwanenburg via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 31 02:54:04 PDT 2016


On Wednesday, 31 August 2016 at 08:38:11 UTC, Andrea Fontana 
wrote:
> Something like this: https://dpaste.dzfl.pl/9fa55b2a7927 ?
>
> Andrea

Or use findAdjacent:

auto idsAreUnique = ids.array.sort.findAdjacent.empty;

http://dlang.org/phobos/std_algorithm_searching.html#.findAdjacent


More information about the Digitalmars-d-learn mailing list