Custom allocator for std::vector<char> is ignored
I was trying to use a custom allocator for std::vector<char> , but I noticed that std::vector does not need/use any of the member functions from my allocator. How is this possible? #include <vector> struct A : private std::allocator<char> { typedef std::allocator<char> alloc; using alloc::value_type; using alloc::pointer; using alloc::const_pointer; using alloc::difference_type; using alloc::size_type; using alloc::rebind; // member functions have been removed, since the program compiles without them }; int main() { std::vector<char, A> v; v.resize(4000); for (auto& c : v) if (c) return 1; //