I'm using a Class (Object) that doesn't have any copy operator : it basically cannot be copied right now. I have a
std::map<int,Object> objects
variable that lists objects with an int identifier. How could I add an Object to this map without having to use copy operators? I tried
objects.insert(std::pair<0,Object()>);
but that won't compile. I would just like to create my object initially inside the map using the default constructor, but writing
objects[0]; fails...
Thanks :)
std::mapneeds to store some sort of value. If not a copy ofObject, perhaps a pointer toObject, assuming theObjectisn't going to go away.