
My 2cents as a data point related to this discussion:
I use polymorphic containers in my projects but I had to implement them
myself
as the poly_collection was not available before and it don't always match
my needs.
I realized through usage that I had very different needs for polymorphic
containers
so maybe it would be interesting to some people here to have some info
about use case.
I have interest in seeing polymorphic containers in boost too.
Here is what I use currently:
- polymorphic collection of vectors:
This is more or less the poly collection, with no guarantee of order
but which does guarantee contiguity of values for one type,
so that it is possible to efficiently go through all the values of one
type.
I tend to use this for several pool-like systems which provide services
for
sets of data which should be processed by the same "thread".
- a container storing only one value per type:
I use this for some kind of type-identified-messages board system
where I just store the last message value of each type of message in the
container.
Of course for one type there can be no value too.
It's more or less a map