Hiding class pointers -- was it a good idea?
Russell Lewis
webmaster at villagersonline.com
Fri Aug 17 09:41:04 PDT 2007
Walter Bright wrote:
> That's known as the 'slicing' problem. It's pernicious in that it can be
> extremely hard to expose via testing or code reviews, yet will expose
> the program to unpredictable behavior.
It frustrates me that people keep conflating what are orthogonal
questions, such as:
- Should we allow copy-assignments of class types?
- Should we allow classes on the stack?
- Should we use '*' to declare pointers-to-classes?
Those are 3 *VERY* different questions. IMHO, we should disallow
copy-assignments of class types (compiler detects the problem and spits
out a clear error message, thus trivially educating the beginners), but
still require the '*'.
More information about the Digitalmars-d
mailing list