Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions std/internal/test/dummyrange.d
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ struct DummyRange(ReturnBy _r, Length _l, RangeType _rt)
{
return arr[0];
}

@property void front(uint val)
{
arr[0] = val;
}
}
else
{
@property uint front() const
{
return arr[0];
}

@property void front(uint val)
{
arr[0] = val;
}
}

static if(rt >= RangeType.Forward)
Expand All @@ -98,19 +98,18 @@ struct DummyRange(ReturnBy _r, Length _l, RangeType _rt)
{
return arr[$ - 1];
}

@property void back(uint val)
{
arr[$ - 1] = val;
}

}
else
{
@property uint back() const
{
return arr[$ - 1];
}

@property void back(uint val)
{
arr[$ - 1] = val;
}
}
}

Expand All @@ -122,18 +121,28 @@ struct DummyRange(ReturnBy _r, Length _l, RangeType _rt)
{
return arr[index];
}

void opIndexAssign(uint val, size_t index)
{
arr[index] = val;
}
}
else
{
uint opIndex(size_t index) const
{
return arr[index];
}

uint opIndexAssign(uint val, size_t index)
{
return arr[index] = val;
}

uint opIndexOpAssign(string op)(uint value, size_t index)
{
mixin("return arr[index] " ~ op ~ "= value;");
}

uint opIndexUnary(string op)(size_t index)
{
mixin("return " ~ op ~ "arr[index];");
}
}

typeof(this) opSlice(size_t lower, size_t upper)
Expand Down