I am trying to take a std::pair and map it to a std::string using a std::map. The way it works being given a pair consisting of a char and a string, map it to a particular string.
This setup so far works just fine(compiler accepts it):
std::map<std::pair<char, std::string>, std::string> mymap;
std::map<std::pair<char, std::string>, std::string>::iterator it;
But when i try to do this:
mymap['a', "Q1"] = "Q4";
mymap['b', "Q2"] = "Q3";
mymap['c', "Q3"] = "Q2";
mymap['d', "Q4"] = "Q1";
it comes back as this error which I do not understand:
Error 1 error C2679: binary '[' : no operator found which takes a right-hand operand of type 'const char [3]' (or there is no acceptable conversion)
which is the error associated under the left bracket of each of the four lines of code(where a red squiggly appears)
can someone help me to understand what I am doing wrong?