I want to write a function that can take either of STL generic list, deque or vector and search for a key in it. What would be method signature of this function and how can we implement it?
What I know is that if we are accepting any of the derived classes in function argument we can use base abstract class assuming all relevant derived ones have the functions you need for your question.
EDIT: We cannot pass container's iterators in the function argument. If we can that is easy. It has to be a container.
I was thinking: Assuming 'Container' is an abstract base class from STL containers (which its not, according to first answer below).
template bool Search(std::Container C, T& key);
Thanks