What if D would require * for reference types?

BCS none at anon.com
Mon Jan 18 16:35:44 PST 2010


Hello Walter,

> Denis Koroskin wrote:
> 
>> What do you think? I understand it is unlikely to make its way into
>> D2 (D3?), but is it sound? Do you think it's useless, or do you think
>> that additional consistency (and functionality) is worthwhile?
>> 
> What this means is that classes will be usable as a value type, like
> in C++. In C++, this causes all sorts of trouble, as a value type and
> a reference type are fundamentally different things with different
> uses.
> 

There is a precedent in C for T* being legal as the type of a variable or 
intermediate value but T not being (for some T): function pointers.

If you forbid the use of the bare Class type (possibly with the exception 
of as an alias for meta coding reasons) your concern becomes moot.





More information about the Digitalmars-d mailing list