pairwise

Apply a predicate over each consecutive pair.

template pairwise(alias pred)
pairwise
(
R
)
(
R r
)

Members

Functions

pairwise
auto pairwise(R r)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

t
{
	import std.algorithm.comparison : equal;
	assert(equal(pairwise!"a+b"([1, 2, 3]), [3, 5]));
	assert(equal(pairwise!"b-a"([1, 2, 3]), [1, 1])

Meta