what was wrong with struct & class in C++?
Walter Bright
newshound1 at digitalmars.com
Thu Dec 13 19:09:52 PST 2007
Russell Lewis wrote:
> Walter Bright wrote:
>> Russell Lewis wrote:
>>> Hear, hear! Good arguments, all! It still doesn't answer why we
>>> left out the little star on class-reference variable assignments. As
>>> I've argued before, the question of syntax is orthogonal to the
>>> question of legal operations. Make value-style operations illegal
>>> for classes, and keep the star there, IMHO.
>>
>> It would make writing generic code unnecessarily difficult.
>
> ???? I thought that one of the key arguments for putting the syntax
> back to the C++ way was that it would make generic code easier to write.
> Right now, when we perform an assignment, generic code can't know
> (without specialization) whether it is assigning a value or a reference
> type.
Because if I replace a struct with a class, then I have to go through
every use of the struct and add a *.
More information about the Digitalmars-d
mailing list