I have a weird situation with virtual classes, and I need help with the design.
- Objects work when destroyed,
- The objects are stored in the vector, but I need to get the object or a link to it from the vector, change it and change this reflection in ALL "copies" of the object,
- I would like the objects to be copied.
I have a solution, but I am looking for the best. This is the code I wrote that does what I'm looking for, but it depends on pointers to pointers to pointers.
It seems to me that if I could directly manipulate the main data pointer of a common pointer, I could get away with one lower level of abstraction.
I would like to do this using one InterfaceWrapper, not two.
#include <stdio.h>
Anything, but I'm especially interested in solutions that work in C ++ 03 using boost (my example is C ++ 11, but my "real" code is C ++ 03 using boost :: shared_ptr).
EXPLANATION
I'm basically looking for a better way to implement InterfaceWrapper2 in my code sample. main() is the best explanation of what I'm trying to accomplish. Just remember that the behavior is stuck in these virtual classes.
source share