Skip to content

Commit

Permalink
Merge pull request #2656 from quickfur/issue13689
Browse files Browse the repository at this point in the history
[trivial] Issue 13689: byCodeUnit fails to be a random access range.
  • Loading branch information
DmitryOlshansky committed Nov 10, 2014
2 parents 2ec073a + 8898fe5 commit 77b4b8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion std/utf.d
Expand Up @@ -2789,7 +2789,7 @@ auto byCodeUnit(R)(R r) if (isNarrowString!R)
void popFront() { r = r[1 .. $]; }
auto ref opIndex(size_t index) inout { return r[index]; }

@property auto ref back() const
@property auto ref back() inout
{
return r[$ - 1];
}
Expand Down Expand Up @@ -2819,6 +2819,8 @@ auto byCodeUnit(R)(R r) if (isNarrowString!R)
R r;
}

static assert(isRandomAccessRange!ByCodeUnitImpl);

return ByCodeUnitImpl(r);
}

Expand Down

0 comments on commit 77b4b8a

Please sign in to comment.