Suppose I have a class called Object. The Object class has a member function that wants to read in strings from a container. Suppose the function looks like this:
template <class InputIterator>
void Object::add(InputIterator first, InputIterator last) { ... }
While this allows the caller to pass strings from an arbitrary container, it does not express the fact that the iterators must be a pair of string iterators.
Is it still appropriate to use templates in this case, or should I force the caller to use a predetermined container of strings?