L
Leigh Johnston
Hi,
Can we please change the ISO C++ Standard so that explicitly states what
happens to a sequence container's capacity() after calling clear()?
Currently the behaviour is unspecified and I know of at least one
implementation that deallocates on vector<T>::clear().
If the behaviour remains unspecified then it is effectively impossible
to write portable code that uses clear() and you have to hope things
such as v.erase(v.begin(), v.end()) behave more consistently across
different implementations.
/Leigh
Can we please change the ISO C++ Standard so that explicitly states what
happens to a sequence container's capacity() after calling clear()?
Currently the behaviour is unspecified and I know of at least one
implementation that deallocates on vector<T>::clear().
If the behaviour remains unspecified then it is effectively impossible
to write portable code that uses clear() and you have to hope things
such as v.erase(v.begin(), v.end()) behave more consistently across
different implementations.
/Leigh