Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumC++custom allocatorsSingle-choice MCQ

When implementing a C++17-conforming allocator, which member is the container actually allowed to call directly on your allocator, versus going through `std::allocator_traits`?

template <typename T> struct MyAlloc { using value_type = T; T* allocate(std::size_t n); void deallocate(T* p, std::size_t n) noexcept; // no construct, destroy, max_size, rebind defined };