bugzilla 3873 std.range.repeat should have popBack defined

This commit is contained in:
Masahiro Nakagawa 2010-05-17 16:34:10 +00:00
parent 093183db7a
commit 5cbe2adf7a

View file

@ -921,7 +921,7 @@ public:
} }
}); });
static if (allSameType && allSatisfy!(hasAssignableElements, R)) static if (allSameType && allSatisfy!(hasAssignableElements, R))
void opIndexAssign(ElementType v, uint index) void opIndexAssign(ElementType v, uint index)
{ {
foreach (i, Unused; R) foreach (i, Unused; R)
@ -1017,10 +1017,10 @@ unittest
auto c = chain(foo, bar); auto c = chain(foo, bar);
c[3] = 42; c[3] = 42;
assert(c[3] == 42); assert(c[3] == 42);
} }
// Make sure bug 3311 is fixed. ChainImpl should compile even if not all // Make sure bug 3311 is fixed. ChainImpl should compile even if not all
// elements are mutable. // elements are mutable.
auto c = chain( iota(0, 10), iota(0, 10) ); auto c = chain( iota(0, 10), iota(0, 10) );
} }
@ -1408,7 +1408,9 @@ struct Repeat(T)
/// Ditto /// Ditto
enum bool empty = false; enum bool empty = false;
/// Ditto /// Ditto
void popFront() {} void popFront() const {}
/// Ditto
void popBack() const {}
/// Ditto /// Ditto
ref T opIndex(uint) { return _value; } ref T opIndex(uint) { return _value; }
} }
@ -2567,4 +2569,4 @@ unittest
{ {
assert(array(e) == witness[i++]); assert(array(e) == witness[i++]);
} }
} }