Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++structured bindingsSingle-choice MCQ

What is the value category and effect of the bindings in the following loop?

#include <map> #include <string> std::map<std::string, int> m{{"x", 1}}; void run() { for (auto& [key, val] : m) { val += 10; // line A // key = "y"; // line B } }