From a8177b8cc3300fd64eef0acb7397be15fb0e0b4c Mon Sep 17 00:00:00 2001 From: monarchdodra Date: Sun, 5 Jan 2014 11:23:31 +0100 Subject: [PATCH] Rework qualifiers in Cycle!Array --- std/range.d | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/std/range.d b/std/range.d index eecac4b0408..2b5433723bb 100644 --- a/std/range.d +++ b/std/range.d @@ -4420,20 +4420,21 @@ struct Cycle(R) private ElementType* _ptr; private size_t _index; +nothrow: this(ref R input, size_t index = 0) { _ptr = input.ptr; _index = index; } - @property auto ref inout(ElementType) front() inout + @property ref inout(ElementType) front() inout { return _ptr[_index % R.length]; } enum bool empty = false; - void popFront() + void popFront() nothrow { ++_index; } @@ -4443,7 +4444,7 @@ struct Cycle(R) return _ptr[(n + _index) % R.length]; } - @property Cycle save() + @property inout(Cycle) save() inout { return this; } @@ -4462,7 +4463,7 @@ struct Cycle(R) return this[i .. $].takeExactly(j - i); } - auto opSlice(size_t i, DollarToken) + auto opSlice(size_t i, DollarToken) inout { return typeof(this)(*cast(R*)_ptr, _index + i); }