isRandomAccessRange!(const(size_t[])) is false ... ?

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Sep 12 15:16:54 PDT 2013


On 9/12/13, Joseph Rushton Wakeling <joseph.wakeling at webdrake.net> wrote:
> import std.range;
>
> void main()
> {
>      assert(isRandomAccessRange!(const(size_t[])));
> }
>
> .... results in an assertion error.  This is a bug, no ... ?

I think ranges have to be non-const. I mean how can you iterate over
one if e.g. popFront can't manipulate the inner state?

Maybe you meant:

const(size_t)[]

P.S. you can use a 'static assert' in your code.


More information about the Digitalmars-d-learn mailing list