adjacentTriples

Undocumented in source. Be warned that the author may not have intended to support it.
adjacentTriples
(
R
)
(
R r
)
if (
isInputRange!R
)

Examples

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

Meta