I have a class which looks like this
template< typename K, typename I >
Class X {
typedef typename map<K,I> Tcontainer1;
typedef typename vector<K> Tcontainer2;
Tcontainer tmap;
public:
typedef typename Tcontainer1::iterator item;
typedef typename Tcontainer1::const_iterator citem;
public:
const K& key(item it);
void container_change(void);
....
}
What I would like to do is dynamically change the container
from the map to the vector when container_change() is initiated.
This means that I would have to change types at runtime! Any
idea how to do this? The problem is that the class is heavily
used and I would not like to change the interface of the class
if possible. Anything I could change internally to achieve this?
Thanks,
--j