custom attribute proposal (yeah, another one)

Steven Schveighoffer schveiguy at yahoo.com
Fri Apr 6 10:41:06 PDT 2012


On Fri, 06 Apr 2012 10:46:33 -0400, Timon Gehr <timon.gehr at gmx.ch> wrote:

> Constructors are functions too, and the compiler can run them too. I  
> think the implementation should just allow any ctfe-callable symbol to  
> be used as an attribute.

This does make sense.  Not having the ctor be an attribute (or the struct  
itself) is an easily-worked around limitation (just create a factory  
function).  It would make sense that you should be able to call a ctor  
just as well as you can call a function, and not have to create a stub  
function that simply calls the ctor.

-Steve


More information about the Digitalmars-d mailing list