Copy constructors for lazy initialization

Michael Rynn michaelrynn at optusnet.com.au
Sat May 29 20:23:51 PDT 2010


On Fri, 28 May 2010 20:26:50 -0500, Andrei Alexandrescu wrote:

> Walter has had a great idea last night: allow classes to define
> 
> this(ref S src);
> 
> where S is the name of the struct being defined, as an alternative for
> 
> this(this);
> 
> The result would be a function similar with a C++ copy constructor.
> 
> S.
> 
> What do you think?
> 
> 
> Andrei


Thats great.
Yet another way to initialize an AA, without having to insert and then 
remove a value.  I just have to make a dummy function and pass the AA to 
it.

Maybe a setup property / function would be easier.




More information about the Digitalmars-d mailing list