Time to kill T() as (sometimes) working T.init alias ?

Walter Bright newshound2 at digitalmars.com
Thu Nov 29 19:22:38 PST 2012


On 11/30/2012 2:21 PM, Walter Bright wrote:
> On 11/29/2012 3:59 PM, Mehrdad wrote:
>> On Thursday, 29 November 2012 at 03:24:40 UTC, Walter Bright wrote:
>>> The original idea is that there should be *no such thing* as default
>>> construction of a struct as being anything other than T.init. The
>>> default construction of a struct should be a compile time creature,
>>> not a runtime one.
>>
>>
>> Why?
>
> So copying them is always an unsurprising bit copy.

Eh, scratch that.

It was so initialization is always an unsurprising bit copy. It means, 
for example, that the constructor for a struct never sees uninitialized 
fields.


More information about the Digitalmars-d mailing list