PStack
2.0
Stack trace printer for MSVC and GCC binaries
|
Disable heap allocation and deallocation. More...
#include <stack_allocated.hpp>
Overloaded Operators | |
static void | operator delete (void *)=delete |
Individual object deletion. | |
static void | operator delete[] (void *)=delete |
Array of type object deletion. | |
static void * | operator new (size_t)=delete |
Individual object allocation. | |
static void * | operator new[] (size_t)=delete |
Array of type allocation. | |
Disable heap allocation and deallocation.
This is a zero-overhead base-class for deleting the various heap-based allocation operators. This way a class can declare its intent without having to tediously delete all the operators. Of course, operators can be reintroduced further down the class heirarchy.
The most obvious case for a stack_allocated object type is some kind of RAII object that manages a resource, and attempts to do so solely within the a single scope (e.g., std::lock_guard
).