I don't understand why assigning to an iterator->second in a std::map modifies the value into the map
#include <typeinfo>
#include <map>
#include <iostream>
int main() {
std::map<int, int> lol;
lol[2] = 33;
auto it = lol.find(2);
it->second = 91; // This changes the map's value
std::cout << typeid(it->second).name(); // This just shows 'int', not a reference
std::cout << lol[2]; // 91
return 0;
}
isn't it->second just an int and not a reference?