Slicing only happens when an object is upcasted by value (is copied upwards in its inheritance hierarchy), like
class Base {};
class Derived : public Base {};
//
Derived d;
Base b = d; //...
CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | VB Forums | Developer.com |
Search:Type: Posts; User: nuzzle Search: Search took 0.03 seconds.
Results 1 to 3 of 3
|
Click Here to Expand Forum to Full Width |