pointers/allocator.hpp

The following code example is taken from the book
C++ Templates - The Complete Guide
by David Vandevoorde and Nicolai M. Josuttis, Addison-Wesley, 2002
© Copyright David Vandevoorde and Nicolai M. Josuttis 2002


#include <stddef.h>

size_t* alloc_counter()
{
    return ::new size_t;
}

void dealloc_counter(size_t* ptr)
{
    ::delete ptr;
}