So, for clarity, am I correct to assume that the root of the problem is that the compiler won't know that "apple" is an std::string without being provided some kind of a hint? Like in the angle brackets in your first example, or that the second input parameter will have the same typename as the map value in your second example?