As title says i got fatal error from for (auto object : Object::getObjects()) when the std::cout << *object->getName(); is called. Here is my code: http://pastebin.com/C0rpAzU7
*objectC->getName()
the `->' operator would already dereference the pointer, ¿why do you need the `*'?
1 2 3 4 5 6
for (auto object : objects) { //a copy
objects_c2.push_back(&object.second); //taking the address of a copy
}
for( auto &object: objects ) //a reference, an alias
objects_c2.push_back(&object.second); //taking the address of the object in the container
You ought to provide a minimal code snip that does reproduce your issue.