Why are not std: allocator static member functions

std:allocator

stateless . In other words, memory being allocated a1.allocate()

( a1

is one instance std::allocator

) can be freed a2.deallocate()

( a2

is another example std::allocator

).

Why aren't they static member functions?

(edited October 17, 2014 :)

Ok, thanks luk32. Since C ++ 11 custom allocator

can have states , that might be the reason std::allocator

those non-static member functions have.

+3


source to share





All Articles