On Thursday, 31 March 2016 at 11:33:36 UTC, Nordlöw wrote:
Is there a function in Phobos to check if a range of integral elements is adjacent, that is

    x[i+1] == x[i] + 1

where x[i] is the i:th element of the range.

(untested)

std.algorithm.findAdjacent!((a, b) => a != b+1)(range).empty;

Reply via email to