I need to compare two maps to see if they are equal. The two maps use strings as keys but the values can be of different types. For example. one map can be <string, int> and the other map can be <string, map<string,int>>. Can anyone suggest a neat solution.
If the value types are different, the function should return false. The value type can be primitive types like int, float, or classes like maps, vectors, lists. And the function should be like a recursion.
One thing to think about is: if two maps have different comparators or different allocators but
identical elements, are they still equal? (map has 4 template parameters).
std::map<> has operator== defined already (though it is only callable if all 4 template parameters
are the same).
typename is needed in a template function or template class which uses the syntax "something :: something"
where one of the somethings is directly dependent upon one of the template parameters. So yes, you need
it on line 15.