Re: refRange and @disable this(this);

2016-09-15 Thread Jacob Carlborg via Digitalmars-d
On 2016-09-14 14:39, Jerry wrote: I got a range which disables copy construction and I want to loop the range within another loop using the same range. So I thought I can mark the struct range with @disable this(this) and then use refRange to initialize the loop. So with something like this:

Re: refRange and @disable this(this);

2016-09-14 Thread Mathias Lang via Digitalmars-d
You should be able to work around this by using `for` loop instead of `foreach`. IMO that's a design bug in `foreach`: https://issues.dlang.org/show_bug.cgi?id=15413 2016-09-14 14:39 GMT+02:00 Jerry via Digitalmars-d < digitalmars-d@puremagic.com>: > I got a range which disables copy

Re: refRange and @disable this(this);

2016-09-14 Thread Jonathan M Davis via Digitalmars-d
On Wednesday, September 14, 2016 12:39:16 Jerry via Digitalmars-d wrote: > I got a range which disables copy construction and I want to loop > the range within another loop using the same range. > So I thought I can mark the struct range with @disable this(this) > and then use refRange to

Re: refRange and @disable this(this);

2016-09-14 Thread Jerry via Digitalmars-d
On Wednesday, 14 September 2016 at 12:39:16 UTC, Jerry wrote: It feels strange that refRange ever want to copy. Bug or feature? Or more specificly, shouldn't save only be defined if the range defines it instead of using copy? Which is presume is the problem.

refRange and @disable this(this);

2016-09-14 Thread Jerry via Digitalmars-d
I got a range which disables copy construction and I want to loop the range within another loop using the same range. So I thought I can mark the struct range with @disable this(this) and then use refRange to initialize the loop. So with something like this: void main() { auto