T.init and @disable this

monarch_dodra monarchdodra at gmail.com
Thu Oct 4 02:29:57 PDT 2012


On Thursday, 4 October 2012 at 09:25:01 UTC, Jonathan M Davis 
wrote:
> 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.

Hum... I had never actually thought of it that way!

>> 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

Good point too.


More information about the Digitalmars-d mailing list