Code to check for memory leaks
Identifiers containing two consecutive underscores are reserved for use by the C++ implementation for any purpose.  That means they can even be macros!  Don't use __ in your identifiers; if you want to keep them separate from user code, you can use a suitable namespace (ideally an anonymous namespace).

Another observation is that this code only keeps count of operations - a double delete could easily cancel a leak and lead your code to report "No leaks discovered".

Although you've kept using namespace std; within a sensible, small scope, I think I'd still prefer using std::cout; using std::endl or just fully-qualified names there.  Consider using std::cerr instead for this kind of information that's not part of normal program output - that may be essential when used in a pipeline.