import std.typecons : t = tuple;
import std.algorithm : equal, map;
auto x = [1, 2, 3, 4, 5, 6, 7].map!(a => a); // test with ForwardRange
auto y = x.adjacentTuples!4;
assert(equal(y, [t(1, 2, 3, 4),
t(2, 3, 4, 5),
t(3, 4, 5, 6),
t(4, 5, 6, 7)]));
import std.typecons : t = tuple;
import std.algorithm : equal;
const x = [1, 2, 3, 4];
auto y = x.adjacentPairs;
assert(equal(y, [t(1, 2), t(2, 3), t(3, 4)]));
import std.typecons : t = tuple;
import std.algorithm : equal;
auto x = ["1", "2", "3", "4"];
auto y = x.adjacentPairs;
assert(equal(y, [t("1", "2"), t("2", "3"), t("3", "4")]));
import std.typecons : t = tuple;
import std.algorithm : equal;
const x = ["1", "2", "3", "4"];
auto y = x.adjacentPairs;
assert(equal(y, [t("1", "2"), t("2", "3"), t("3", "4")]));