The cpp nsAutoPtr.forget function is used to transfer the ownership of a dynamically allocated object to another nsAutoPtr instance without triggering the deletion of the underlying object. By calling the forget function, the original nsAutoPtr instance releases its ownership of the object and returns a raw pointer to the caller. The new nsAutoPtr instance gains the ownership of the object, allowing for seamless transfer of ownership and preventing multiple deletions of the same object.
C++ (Cpp) nsAutoPtr::forget - 17 examples found. These are the top rated real world C++ (Cpp) examples of nsAutoPtr::forget extracted from open source projects. You can rate examples to help us improve the quality of examples.