
First of all, if this is a not correct mailing list, please forward the letter to a correct. Thank you. Well.. Consider this code: struct LibraryClass { Object* create_object(); void push_in_stack_object(Object* ); }; In this case library user meets with ambiguity, should him destroy this pointers after using these methods, or not. I just thought out some very simple and small wrapper class, and name it intact_ptr<> which the only way to say library user, that this pointer user should not delete after using (in case of create_object method) or library will not own the pointer (in push_in_stack_object method). It seems that sometimes it's useful. Also this class can decide another pointer related problems, like unwantable increment/decrement operations, pointers equality comparing and so on.
participants (1)
-
Yashin Evgeny