Related: Deprecation of std::allocator<void>.
The following description about template parameter Allocator
is found for both std::vector
and std::list
(emphasis mine):
An allocator that is used to acquire/release memory and to construct/destroy the elements in that memory. The type must meet the requirements of Allocator. The behavior is undefined if
Allocator::value_type
is not the same asT
.
The last sentence does not make sense to me. If a specific value_type
is required, couldn't it just do an allocator rebind?
allocator_type
expression. – Burdockstd::list
is almost certainly rebinding to an internal node type – Bankhead