T.init and @disable this

Jonathan M Davis jmdavisProg at gmx.com
Thu Oct 4 02:18:18 PDT 2012


On Thursday, October 04, 2012 10:18:14 monarch_dodra wrote:
> Making it illegal would pretty much make T unmoveable,
> un-emplaceable, un-initializeable on un-initialized memmory,

That's kind of the point. If that's not what you want, don't disable init.

> and
> would probably break more than one function/trait which uses
> "T.init"

Which is a definite downside to the whole disabling init idea.

As for T.init and constructors, it should be perfectly possible to initialize 
the object to what T.init would be prior to construction without making T.init 
available at all.

- Jonathan M Davis


More information about the Digitalmars-d mailing list