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 :)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…