Re: DMD2, Phobos: striding range

2010-03-26 Thread Mihail Strashun
Philippe Sigaud wrote: On Mon, Mar 8, 2010 at 13:00, Lars T. Kyllingstad pub...@kyllingen.nospamnet wrote: It's definitely a bug. I've reported it: http://d.puremagic.com/issues/show_bug.cgi?id=3894 std.range use ref everywhere. I had to comment them out to get any composition

Re: initializing immutable structs

2010-03-26 Thread bearophile
Paul D. Anderson: The primary difficulty is that I can't use a static initializer but need to use a constructor instead. But the constructor isn't allowed as it's non-constant expression. How do I declare the struct variable and initialize it separately? The second difficulty is that

Re: Never called destructor

2010-03-26 Thread bearophile
div0: This is clearly wrong, we are accessing a deleted object, and for some reason we aren't getting a double delete of y, which we should. Thank you for the nice example, I think it's doing the struct return optimization trick invented by Walter ages ago :-) scope for objects is a very

Re: DMD2, Phobos: striding range

2010-03-26 Thread Philippe Sigaud
On Fri, Mar 26, 2010 at 11:16, Mihail Strashun m.stras...@gmail.com wrote: Hm, changing ref on lines 716 and 724 to auto ref changes nothing. Changing it to simply auto seems to solve problem. How auto ref feature is supposed to work? This ( http://www.digitalmars.com/d/2.0/function.html )

dup and arrays

2010-03-26 Thread Ellery Newcomer
I just noticed that dup does not dup deep. In a two second search I couldn't find any reason for or against, but I'd kinda like it if auto r2 = r.dup; r2[i][j] = 0; r[i][j] = 1; assert(r2[i][j] != r[i][j]); held.

Re: dup and arrays

2010-03-26 Thread strtr
Ellery Newcomer Wrote: I just noticed that dup does not dup deep. In a two second search I couldn't find any reason for or against, but I'd kinda like it if auto r2 = r.dup; r2[i][j] = 0; r[i][j] = 1; assert(r2[i][j] != r[i][j]); held. There have been discussions about this