Idiomatic adjacent_difference

Guillaume Chatelet via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Oct 16 04:11:26 PDT 2015


Is there an idiomatic way to do:

int[] numbers = [0, 1, 2, 3];
assert(adjacent_diff(numbers) == [1, 1, 1]);

I can't find something useful in the std library.


More information about the Digitalmars-d-learn mailing list