Andrei Alexandrescu wrote: > The issues are discussed in the book C++ Coding Standards and also in > More Effective C++. Part of the problem is slicing, which you may want > to google for.
I'm aware of slicing. I didn't really think of it as a problem. But now that you mention it, I suppose it can be confusing. And perhaps violate class invariants. There may be a solution. What I'm thinking now is that in the background, the heap may be used, as long as this is transparent to the programmer. i.e. assignment still makes a copy, comparison still compares the objects, not the addresses. But a base class value variable still has a superclass object in the background. This requires some thinking. Thanks for the clarification. -- Michiel Helvensteijn
