sameHead

Determines whether r1.front and r2.front point to the same element.

@trusted
bool
sameHead
(
Range
)
(
Range r1
,
Range r2
)

Parameters

r1 Range

First range.

r2 Range

Second range.

Return Value

Type: bool

$(D_KEYWORD true) if r1 and r2 have the same head, $(D_KEYWORD false) otherwise.

Examples

const int[2] array;

auto r1 = array[];
auto r2 = array[];

assert(sameHead(r1, r2));
const int[2] array;

auto r1 = array[];
auto r2 = array[1 .. $];

assert(!sameHead(r1, r2));

Meta