Reducing an array

Tim Holzschuh via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 17 06:46:25 PDT 2014


Hi there,

I try to remove all equal elements of an array, thus [2,2] --> [2].

I thought this maybe would be possible with std.algorithm.reduce, but at 
least the way I tried it doesn't work:

arr.reduce( (a,b) => a != b );

Is there a simple solution using Phobos-functions?

Thank you,
     Tim


More information about the Digitalmars-d-learn mailing list