i realize that that's the way it SUPPOSED to work... but for some WEIRD reason defining a copy constructor helps... don't ask me, i just push buttons!
vectors of pointers
Quote:Original post by zappernapper
i realize that that's the way it SUPPOSED to work... but for some WEIRD reason defining a copy constructor helps... don't ask me, i just push buttons!
You changed something else that actually fixed the problem and don't realize it, or else you aren't dealing with pointers. Off hand, I notice that your original push_back and the one a few posts later do very different things. In particular, the original would create a copy if it weren't a compile error. Or you are creating copies somewhere [Object copy = *g_vObjects.front(), for instance] and don't realize it. My guess would be this latter case.
CM
Quote:Original post by Conner McCloudQuote:Original post by zappernapper
i realize that that's the way it SUPPOSED to work... but for some WEIRD reason defining a copy constructor helps... don't ask me, i just push buttons!
You changed something else that actually fixed the problem and don't realize it, or else you aren't dealing with pointers. Off hand, I notice that your original push_back and the one a few posts later do very different things. In particular, the original would create a copy if it weren't a compile error. Or you are creating copies somewhere [Object copy = *g_vObjects.front(), for instance] and don't realize it. My guess would be this latter case.
CM
Yes. To OBI-Wan you listen [grin]
Something else in your code is causing the problems/fixes. You're relying on undefined behavior or compiler-dependant behavior somewhere.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement