| High Integrity CPP Rule 17.5 | Do not attempt to insert derived class objects in a container that holds base class objects. |
| Justification |
If you attempt to insert an object of derived type into a container of base type objects then slicing will occur and the container will not hold the intended object. The problem of slicing is eliminated when pointers to base class objects are stored. |
| See also |
| Reference |
Effective STL Items 3, 7; |