#include <glv_util.h>
Public Member Functions | |
SmartPointer (bool del=true) | |
bool | smartDelete () |
Deletes object only if it is deletable, i.e. not a reference. | |
void | deletable (bool v) |
Set whether the object can be deleted. | |
bool | deletable () |
Returns whether the object can be deleted. |
When a class contains pointers to other objects, sometimes it is not clear if it is responsible for freeing the memory associated with those objects.
glv::SmartPointer::SmartPointer | ( | bool | del = true |
) | [inline] |
[in] | del | whether the object is deleted with smartDelete() |
bool glv::SmartPointer::smartDelete | ( | ) | [inline] |
Deletes object only if it is deletable, i.e. not a reference.
Returns true if the object destructor was called, false otherwise.