According to http://www.cplusplus.com/reference/map/map/, I can use either m[k]
or m.at(k)
to access the value of a key k
in a map m
. However, when I try to do
derivMap[fx]
in my code, where derivMap is an element of type std::map<std::string,std::string>
Visual Studio 2013 gives me the warning
no operator [] matches these operands
However, when I change my code to
derivMap.at(fx)
I get no error. Do you have any insight into this issue?
See Question&Answers more detail:os