Generically overloading operator new while considering alignment requirements
问题 Situation I am writing a memory manager for dynamic memory (de)allocations. For a class A to use it when operator new (or delete ) is called, it is sufficient for class A to inherit from a class CustomAllocate , which itself overloads new and delete in a way that uses the memory manager. Problem However, apparently I completely missed out on alignment requirements. Unfortunately, CustomAllocate::new has no information about how a class A inheriting from it should be aligned as the only