Skip to content

Commit

Permalink
Yet another try
Browse files Browse the repository at this point in the history
  • Loading branch information
nordlow committed Oct 15, 2014
1 parent b2a4ca2 commit 9daf235
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions std/container/array.d
Expand Up @@ -288,7 +288,12 @@ Defines the container's primary range, which is a random-access range.
return move(_outer._data._payload[_a + i]);
}

ref inout(T) opIndex(size_t i) inout
ref const(T) opIndex(size_t i) const
{
version (assert) if (_a + i >= _b) throw new RangeError();
return _outer[_a + i];
}
ref T opIndex(size_t i)
{
version (assert) if (_a + i >= _b) throw new RangeError();
return _outer[_a + i];
Expand All @@ -298,7 +303,7 @@ Defines the container's primary range, which is a random-access range.
{
return typeof(this)(_outer, _a, _b);
}
Range!A opSlice()
Range!(A) opSlice()
{
return typeof(this)(_outer, _a, _b);
}
Expand All @@ -308,7 +313,7 @@ Defines the container's primary range, which is a random-access range.
version (assert) if (i > j || _a + j > _b) throw new RangeError();
return typeof(this)(_outer, _a + i, _a + j);
}
Range!A opSlice(size_t i, size_t j)
Range!(A) opSlice(size_t i, size_t j)
{
version (assert) if (i > j || _a + j > _b) throw new RangeError();
return typeof(this)(_outer, _a + i, _a + j);
Expand Down Expand Up @@ -436,11 +441,11 @@ forward order.
Complexity: $(BIGOH 1)
*/
Range!(const(Array)) opSlice() const
Range!(const(Array!T)) opSlice() const
{
return typeof(return)(this, 0, length);
}
Range!Array opSlice()
Range!(Array!T) opSlice()
{
return typeof(return)(this, 0, length);
}
Expand All @@ -453,12 +458,12 @@ Precondition: $(D a <= b && b <= length)
Complexity: $(BIGOH 1)
*/
Range!(const(Array)) opSlice(size_t i, size_t j) const
Range!(const(Array!T)) opSlice(size_t i, size_t j) const
{
version (assert) if (i > j || j > length) throw new RangeError();
return typeof(return)(this, i, j);
}
Range!Array opSlice(size_t i, size_t j)
Range!(Array!T) opSlice(size_t i, size_t j)
{
version (assert) if (i > j || j > length) throw new RangeError();
return typeof(return)(this, i, j);
Expand Down

0 comments on commit 9daf235

Please sign in to comment.