Here is an example of option 2 I described:
Code:
namespace std {
template<> inline void swap(Model &a, Model &b) throw() {
std::swap(a.displayList, b.displayList);
std::swap(a.shaderProgram, b.shaderProgram);
std::swap(a.faces, b.faces);
std::swap(a.vertices, b.vertices);
std::swap(a.texels, b.texels);
std::swap(a.normals, b.normals);
std::swap(a.numFaces, b.numFaces);
std::swap(a.totalVertices, b.totalVertices);
std::swap(a.totalTexels, b.totalTexels);
std::swap(a.totalNormals, b.totalNormals);
std::swap(a.numMaterials, b.numMaterials);
std::swap(a.numTextures, b.numTextures);
}
};
// ...
map<int, Model> models;
Model myModel("Monster.mdl");
std::swap(models[42], myModel);
phantomotap shows another very good way to do it.
Note that you should still also make sure you follow the rule of three here. You needed to implement the destructor, so you also need to either implement the copy-constructor and assignment operator, OR you should declare them but make them private and leave them unimplemented, to prevent them from ever being used.