Ramesh wrote:
Hi,
I am a newbie to C++ & boost, I have questions on choosing the right boost container for my requirement.
<snip>
Questions I have:
1) As I would create objects of either Derived Class I or Derived Class II (which would be known to be only at runtime) and I need to add pointers to these objects in a container, I would like to know which container would suit best??
I think perhaps the ptr_container library might be a good fit.
2) Also, I should be able to perform lookups based on playerId field in the container,playerId would be an auto generated field for every object created (irrespective of Derived Class I or Derived class II), please advice on which container to choose in boost.
I would see if http://www.boost.org/doc/libs/1_35_0/libs/ptr_container/doc/ptr_map.html is what you are looking for. --John