Hiding class pointers -- was it a good idea?
Walter Bright
newshound1 at digitalmars.com
Thu Aug 16 02:09:02 PDT 2007
James Dennett wrote:
> Walter Bright wrote:
>> Value types are fundamentally different from reference types. D gives
>> you the choice.
>
> C++ gives you *more* choice by allowing easier migration between
> the two without imposing performance or syntactic differences.
That isn't my experience. In my work on DMDscript in D, I changed some
types between struct and class to try out some variations, and found it
to be a lot easier than in C++. For one thing, I didn't have to find and
edit all the -> and .'s.
But you're right that C++ allows you more choice - you can create a
polymorphic type with value semantics. I think D is better off without
them, however.
More information about the Digitalmars-d
mailing list