Re: Quick question about new semantics

2012-09-15 Thread Maxim Fomin
2012/9/14 monarch_dodra : > I have a struct, which defines a constructor that takes an argument. > > Now, I'd like to new this object, to it's default T.init value (eg call new, > but now constructors): > > > struct S > { > this(int); > } > > void main() > { > auto p1 = new S; >

Re: Quick question about new semantics

2012-09-14 Thread Jonathan M Davis
On Friday, September 14, 2012 20:27:56 monarch_dodra wrote: > I have a struct, which defines a constructor that takes an > argument. > > Now, I'd like to new this object, to it's default T.init value > (eg call new, but now constructors): > > > struct S > { > this(int); > } > > void mai

Re: Quick question about new semantics

2012-09-14 Thread Steven Schveighoffer
On Fri, 14 Sep 2012 14:27:56 -0400, monarch_dodra wrote: I have a struct, which defines a constructor that takes an argument. Now, I'd like to new this object, to it's default T.init value (eg call new, but now constructors): struct S { this(int); } void main() { auto