I have an abstract base class called Shape from which both Circle and Rectangle are derived, but when I execute the following code in VS 2005 I get the error Debug assertion
Simple :
For it to work like you want, you do need to compare Shape, not Shape*
As pointed out in other answers, boost::ptr_vector is an easy way to achieve this.