idup class

2014-05-16 Thread Joshua Niehus via Digitalmars-d-learn
trying to follow: http://ddili.org/ders/d.en/class.html //--- OSX 10.9 DMD 2.065 module test; class Foo { int num; this(int num) { this.num = num; } Foo dup() const { return new Foo(this.num); } immutable(Foo) idup() const { return new

Re: idup class

2014-05-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On Fri, 16 May 2014 16:28:41 -0400, Joshua Niehus jm.nie...@gmail.com wrote: trying to follow: http://ddili.org/ders/d.en/class.html //--- OSX 10.9 DMD 2.065 module test; class Foo { int num; this(int num) { this.num = num; } Foo dup() const {

Re: idup class

2014-05-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On Fri, 16 May 2014 16:36:36 -0400, Ali Çehreli acehr...@yahoo.com wrote: Beat you by 8 seconds :) -Steve

Re: idup class

2014-05-16 Thread Ali Çehreli via Digitalmars-d-learn
On 05/16/2014 01:28 PM, Joshua Niehus wrote: trying to follow: http://ddili.org/ders/d.en/class.html //--- OSX 10.9 DMD 2.065 module test; class Foo { int num; this(int num) { this.num = num; } Foo dup() const { return new Foo(this.num);

Re: idup class

2014-05-16 Thread Ali Çehreli via Digitalmars-d-learn
On 05/16/2014 01:37 PM, Steven Schveighoffer wrote: On Fri, 16 May 2014 16:36:36 -0400, Ali Çehreli acehr...@yahoo.com wrote: Beat you by 8 seconds :) -Steve I am happy to be within one minute. :) Ali

Re: idup class

2014-05-16 Thread Joshua Niehus via Digitalmars-d-learn
On Friday, 16 May 2014 at 20:36:37 UTC, Ali Çehreli wrote: My apologies. The code was written for an older version of dmd. The simplest fix is to define the constructor as pure: pure this(int num) { this.num = num; } Ali Ahh great thanks guys. No worries Ali, great