How do I distinguish template arguments by a typedef?
Situation: I have lists (implemented as vectors) of several types. And I have a special StringList which I want to handle differently.
typedef std::vector<std::string> StringList;
inline void f(StringList const& list) {
...
}
template <typenamte T>
inline void f(std::vector<T> const& list) {
...
}
In cases where my variables are defined als StringList
I would like to have the first version called, when a variable is defined as std::vector<std::string>
I would like to have the second version called. But StringList
and std::vector<std::string>
call the first version. Using using
gives the same behaviour.
If that is not possbile, an idea for a reasonable workaround would be nice.
Of course extending std::vector<std::string>
would help, but since that is not a good idea at all I don't know how to distinguish them.