First of all: I'm still a beginner in c ++, but I don't really understand the following:
So someone said to me, that if i have for example a container of references (e.g. map), it is not working because "under the hood, containers allocate memory and then assign into those spots. And references cant be assigned after they are created". Which made sense to me, but then i tested it with "const int" for example, and it did work, but why did it work? Doesnt const int have the same problem? Isnt it like the same, that i cant assign to "const" afterwards?
EDIT 2.0: So i basically mean this:
map<int, const int> m1{ {20,20} }; //Working, but why?
map<int, int&&> m2{ {20,20} }; //Not working, makes sense.
Sorry for my english, I hope you could understand what I meant.