( 8 months ago )
A pointer like "M" will not match later another pointer "M" or a &string("M"). It's the same type (const char*) but a different value, and you use as a key the value of the pointer which is different.
x["m"] = 5;
int y = x["m"]; // y not necessarily 5.
"m" in line 3 and "m" in the previous line have different pointer values. The compiler might optimize with string pooling, leading you to believe that it worked, but it is actually a hard to find bug.