This is my code:
std::map<std::string, std::string> map = {{"a","b"},{"c","d"}};
for(auto& [key,value] : map) {
key = std::string("c");
value = std::string("c");
}
and when i compile it i get
error: no viable overloaded '='
what i'm doing wrong? Shouldn't key
and value
be reference to string
?