I'd like to present some idea on a simple code sample:
class Base{
public:
void doSomeNastyThings(int param)
{
IteratorInterface *iter_face = iterators[param];
for(auto it = iter_face->begin(); it != iter_face->end(); it++)
{
//do another nasty things
}
}
protected:
std::map<int, IteratorInterface*> iterators;
};
And I wish to populate an iterators map from derived classes.... But how can I create such an IteratorInterface in STL style? All iterators will provide me an access to the same type (let me call it 'T'), but they can have different types:
std::map<T>::iterator, std::vector<T>::iterator, foo<T>::iterator.