I have a class that contains 2 vectors, and I'd like for that class to provide a public interface to access the next element in either list. The easy way to do it is to obviously return the list itself, either const or not, but this seems to go completely against data abstraction. If I have a function like:
const std::vector<std::string>& GetCommandList() const then I'm telling anyone that uses my class that they can expect a string vector, and now I'm stuck with vector, even if I want to change the storage solution in the future.
As c++ doesn't seem to have a generic iterator, what do people usually do for this? Do I create a custom iterator class for each list? This really seems excessive...