how do i create STL assortment of classes which implement abstract base class while using base class as collection value, without needing pointers?

can there be something in Boost that enables me to implement it? The gathering particularly is map.


You can't avoid pointers completely. You have to store pointers within the collection if you wish to avoid Object slicing. Boost includes a container that hides the pointers pretty much: ptr_map

The Boost Pointer Container Library does what you would like.

You cannot

Consider the way the compiler would generate code to achieve that ? No pointers implies that the storage needs to be allotted "within the collection itself" inside a static array or something like that. However the storage needed for that subclasses can alter ! Just how would the compiler get it done ? ... it cannot ...