How would I define a function that takes as input an iterator over any type of STL container, but only to those of a specific templated type. For example:
Any iterator o
Well i would use a simple typedef in the case that you only need one container-type at the time (if i understood your usecase correctly this is the case)
template
class ContainerIterator
{
Container();
public:
typedef std::list::iterator type;
}
//usage:
void function(ContainerIterator::type begin, ContainerIterator::type end)
{
//...
}
to switch the container later on, simply change the container type in the typedef.