Or use a proper memory checking tool instead of rolling your own.
Printable View
Or use a proper memory checking tool instead of rolling your own.
Well yeah, it's not a fool proof solution. I'm just writing it for fun.
I use smart pointers all the time anyway.
I really can't see a solution through the delete operator so I'm just going to have create a debug_delete.
UPDATE:
I wasn't able to create anything without a debug_delete.
I created a debug_new, as well, to extend the functionality of the framework.
Now it detects memory leaks, NULL dereferencing, proper deleting of arrays (delete vs delete[]), and even stops you from deleting twice!
Well, you can still hand it an invalid pointer and delete, but... oh well, nothing is perfect.
Some meta programming + some boost and this is the result!