Fix Issue 8866 - Splitter(R1, R2) CANNOT be bidirectional.

This commit is contained in:
monarchdodra 2013-08-14 18:55:15 +02:00
parent b41457571b
commit 9d158ba52d

View file

@ -2773,7 +2773,6 @@ unittest
auto s2 = splitter(d, [4, 5]); auto s2 = splitter(d, [4, 5]);
assert(equal(s2.front, [1,2,3])); assert(equal(s2.front, [1,2,3]));
assert(equal(s2.back, [6,7,8,9,10]));
} }
} }
} }
@ -2914,12 +2913,16 @@ if (is(typeof(Range.init.front == Separator.init.front) : bool)
// Bidirectional functionality as suggested by Brad Roberts. // Bidirectional functionality as suggested by Brad Roberts.
static if (isBidirectionalRange!Range && isBidirectionalRange!Separator) static if (isBidirectionalRange!Range && isBidirectionalRange!Separator)
{ {
//Deprecated. It will be removed in December 2015
deprecated("splitter!(Range, Range) cannot be iterated backwards (due to separator overlap).")
@property Range back() @property Range back()
{ {
ensureBackLength(); ensureBackLength();
return _input[_input.length - _backLength .. _input.length]; return _input[_input.length - _backLength .. _input.length];
} }
//Deprecated. It will be removed in December 2015
deprecated("splitter!(Range, Range) cannot be iterated backwards (due to separator overlap).")
void popBack() void popBack()
{ {
ensureBackLength(); ensureBackLength();