Why is shrink_to_fit non-binding?

Posted by Roger Pate on Stack Overflow See other posts from Stack Overflow or by Roger Pate
Published on 2010-04-18T21:31:29Z Indexed on 2010/04/18 21:33 UTC
Read the original article Hit count: 406

The C++0x FCD states in 23.3.6.2 vector capacity:

void shrink_to_fit();

Remarks: shrink_to_fit is a non-binding request to reduce capacity() to size(). [Note: The request is non-binding to allow latitude for implementation-specific optimizations. —end note]

Why is it non-binding, and what optimizations are intended to be allowed?

© Stack Overflow or respective owner

Related posts about c++

Related posts about c++0x