Is it possible to push a struct into a vector without the original object being destroyed and the copy constructor called (other than wrapping the vector in another class)?
The issue is that there is a static class variable that keeps track of pointers to dynamically allocated memory.
When an object is destroyed, the pointer is removed from this vector. If no other pointers to the same memory exist in the vector, it is deallocated.
I could write my own copy constructor to add the pointer there as well, but I'd have to assign every member variable manually, remember to go back and change it if I add any new members to the class, etc.
It's a little tedious. I was wondering if there's an easier way