change 'this' pointer for structs to reference type

Walter Bright newshound1 at digitalmars.com
Mon Nov 3 21:04:35 PST 2008


BCS wrote:
> Reply to Walter,
> 
>> Denis Koroskin wrote:
>>
>>> Will the following code:
>>> typeof(this) foo = new typeof(this);
>>> work as expected?
>>>
>> No, because new will still return a typeof(this)*.
>>
> 
> In struct, yes, but not in classes I wouldn't think?
> 
> 

Right, not for classes.



More information about the Digitalmars-d mailing list