On a related note (to my last email, “MallocAllocator returns nonnull?”), I noticed that there are lots of C-style casts in Allocator.h; is there a reason to use C-style casts here? They make my eyes burn!
I also wouldn’t be surprised if they cause strange operator precedence issues for someone in the future.
char *Begin = (char*)alignAddr(*I, alignOf<T>()); char *End = *I == Allocator.Slabs.back() ? Allocator.CurPtr : (char *)*I + AllocatedSlabSize;
DestroyElements((char*)alignAddr(Ptr, alignOf<T>()), (char *)Ptr + Size);