https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87544

--- Comment #8 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #6)
> I think the standard specifies the fallback value in allocator_traits for
> allocators that do not provide max_size (we could open an issue asking for
> more freedom in the choice of this value, as long as there is a default, and
> maybe also the freedom to return something smaller than a.max_size() when
> that value is provided), but it does not specify what
> std::allocator::max_size should return (though this function is deprecated),

It's deprecated because the default provided by allocator_traits is supposed to
be equivalent, making it redundant. But it's not equivalent. The fact that
std::allocator<T>::max_size() was underspecified does mean we're allowed to
return a sane value, and so it probably shouldn't be deprecated.

I've raised this with the LWG.

I hate max_size() so much.

Reply via email to