For vector<>, deque<>, and string<> the new member function shrink_to_fit() is missing.
Yeah, *a lot* of C++0x things are missing, or still incorrectly implemented, in general we are not tracking in Bugzilla each!
Ok, let's re-open this and add the basic implementation in time for gcc4.5 (C++0x mode only of course).
Nope... I went through this and came to the conclusion that a fairly good implementation has to wait for a complete resolution of N2983: the request is non-binding thus if the move constructor can throw and the type T isn't CopyConstructible the implementation should not do anything. Given the subtleties wrt throwing move constructors recently surfaced, I think we'll add this member in due course, in any case *after* having tweaked the internals of the std containers for the other traditional member functions...
It would be conforming to add the function with an empty body ;)
Good joke and also good point Jon: I still believe that our C++0x user interfaces, even not considering the semantics, aren't yet such complete and otherwise perfect to grant that action, but all in all, if somebody wants to add the empty bodies with a BIG TODO comment in the code, I do not object...
Ok, Jon, you convinced me: I'll add the interfaces, and a very, very basic implementation for vector and deque for now, I think just do something for PODs (reminder to ourselves, change the dispatches in unitialized_* functions, etc, to use to most strict yet correct traits)
Subject: Bug 42573 Author: paolo Date: Fri Jan 8 13:01:24 2010 New Revision: 155733 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=155733 Log: 2010-01-08 Paolo Carlini <paolo.carlini@oracle.com> PR libstdc++/42573 * include/bits/allocator.h (struct __shrink_to_fit): Add. * include/bits/stl_deque.h (deque<>::shrink_to_fit): Add. * include/bits/stl_vector.h (vector<>::shrink_to_fit): Likewise. * include/bits/stl_bvector.h (vector<bool>::shrink_to_fit): Likewise. * include/bits/basic_string.h (basic_string<>::shrink_to_fit): Likewise. * include/ext/vstring.h (__versa_string<>::shrink_to_fit): Likewise. * include/debug/deque: Add corresponding using declaration. * include/debug/vector: Likewise. * include/debug/string: Likewise. * include/profile/deque: Likewise. * include/profile/vector: Likewise. * config/abi/pre/gnu.ver: Export new symbols. * testsuite/23_containers/deque/capacity/shrink_to_fit.cc: New. * testsuite/23_containers/vector/capacity/shrink_to_fit.cc: Likewise. * testsuite/21_strings/basic_string/capacity/char/shrink_to_fit.cc: Likewise. * testsuite/21_strings/basic_string/capacity/wchar_t/shrink_to_fit.cc: Likewise. * testsuite/ext/vstring/capacity/shrink_to_fit.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/deque/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/deque/requirements/dr438/ constructor_2_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/assign_neg.cc: Adjust dg-error line number. * testsuite/23_containers/vector/requirements/dr438/insert_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_1_neg.cc: Likewise. * testsuite/23_containers/vector/requirements/dr438/ constructor_2_neg.cc: Likewise. Added: trunk/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/shrink_to_fit.cc trunk/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/shrink_to_fit.cc trunk/libstdc++-v3/testsuite/23_containers/deque/capacity/shrink_to_fit.cc trunk/libstdc++-v3/testsuite/23_containers/vector/capacity/shrink_to_fit.cc trunk/libstdc++-v3/testsuite/ext/vstring/capacity/shrink_to_fit.cc Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/config/abi/pre/gnu.ver trunk/libstdc++-v3/include/bits/allocator.h trunk/libstdc++-v3/include/bits/basic_string.h trunk/libstdc++-v3/include/bits/stl_bvector.h trunk/libstdc++-v3/include/bits/stl_deque.h trunk/libstdc++-v3/include/bits/stl_vector.h trunk/libstdc++-v3/include/debug/deque trunk/libstdc++-v3/include/debug/string trunk/libstdc++-v3/include/debug/vector trunk/libstdc++-v3/include/ext/vstring.h trunk/libstdc++-v3/include/profile/deque trunk/libstdc++-v3/include/profile/vector trunk/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/assign_neg.cc trunk/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_1_neg.cc trunk/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/constructor_2_neg.cc trunk/libstdc++-v3/testsuite/23_containers/deque/requirements/dr438/insert_neg.cc trunk/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/assign_neg.cc trunk/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_1_neg.cc trunk/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/constructor_2_neg.cc trunk/libstdc++-v3/testsuite/23_containers/vector/requirements/dr438/insert_neg.cc
Done (within the limits explained in the audit trail).