This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3 patch] Implement LWG 2466 (allocator_traits::max_size() is stoopid)


On 05/13/2015 06:21 AM, Jonathan Wakely wrote:
http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#2466

We agreed to move this to Ready in Lenexa.

I'd like to see max_size() deprecated, it's useless, but if we can't
do that it might as well not give an impossible answer.

FWIW, I think it's unfortunate that the LWG decided in their
response to issue 197 to leave max_size so poorly specified
as to render it useless.

The function can be made useful by having each container use
Allocator::max_size in determining its maximum size. It doesn't
cost anything in terms of efficiency (for the default Allocator)
but allows programs to provide a specialized Allocator that
returns a value that controls the size of each container object.

We implemented this in response to user requests and I found
it quite useful myself when testing the containers.

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]