Why there are no 'physical' object variables (only references)?

Lionello Lunesu lio at lunesu.remove.com
Mon Sep 11 22:59:52 PDT 2006


BCS wrote:
> Sean Kelly wrote:
>> Kristian wrote:
>>
>>>
>>> Hmm, what if structures could have interfaces and 
>>> constructors/destructors... and what the heck, inheritance too? 
>>> Hehheh, this way we would have 'physical classes' for local use and 
>>> 'reference classes' for global use.
>>
>>
>> It will never happen :-)  Though ctor support would be nice, at the 
>> very least.  That would simplify initialization and eliminate the need 
>> for the static opCall trick.
>>
>>
>> Sean
> 
> There is no technical reason struct (or anything that can produce a 
> delegate) can't do interfaces. Inheritance on the other hand... I hope 
> that never happens.

Wouldn't it add a hidden __vtbl to your struct and thereby increasing 
its size?

L.



More information about the Digitalmars-d mailing list