diff --git a/KeyBuffer.h b/KeyBuffer.h index 4468220..3275255 100644 --- a/KeyBuffer.h +++ b/KeyBuffer.h @@ -19,6 +19,7 @@ #include #include +#include #include namespace android { @@ -31,6 +32,12 @@ class ZeroingAllocator : public std::allocator { memset_explicit(p, 0, n); std::allocator::deallocate(p, n); } + + template + struct rebind { + static_assert(std::is_same_v, "ZeroingAllocator is only defined for char"); + using other = ZeroingAllocator; + }; }; // Char vector that zeroes memory when deallocating.