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

An allocator is rebound during container construction. Why does a standard container require `rebind` (or `allocator_traits::rebind_alloc`) even when you declare `std::list<int, MyAlloc<int>>`?

std::list<int, MyAlloc<int>> lst; // MyAlloc<int> was supplied, but the list never // allocates a bare 'int'.