Giving the C++ Standard Committee control of the public interface of your type means they will break it. C++23 adds a new allocate_at_least
member to std::allocator
. Very bad things happen when, say, std::vector
uses allocate_at_least
from secure_allocator
’s base to allocate memory which it then tries to free with secure_allocator::deallocate
.
(Discovered by microsoft/STL#3712, which will be reverted by microsoft/STL#3819 before it ships.)