这是我的代码:
std::map<std::string, std::string> map = {{"a","b"},{"c","d"}};
for(auto& [key,value] : map) {
key = std::string("c");
value = std::string("c");
}
当我编译它时,我得到
error: no viable overloaded '='
我做错了什么?不key
应该value
参考string
吗?