Bug 3873 – std.range.repeat should have popBack defined
Status
RESOLVED
Resolution
FIXED
Severity
trivial
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-03-04T05:59:00Z
Last change time
2015-06-09T01:27:41Z
Assigned to
nobody
Creator
philippe.sigaud
Comments
Comment #0 by philippe.sigaud — 2010-03-04T05:59:19Z
std.range.repeat does not define a popBack method and as such cannot be used as a bidirectional range.
Here is the code with the (almost non-existent...) missing function:
struct Repeat(T)
{
private T _value;
ref T front() { return _value; }
ref T back() { return _value; }
enum bool empty = false;
void popFront() {}
void popBack() {}
ref T opIndex(uint) { return _value; }
}