stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: test for lib.string.swap
Date Tue, 16 May 2006 01:36:08 GMT
Anton Pevtsov wrote:
> The test for lib.string.swap and required changes to the
> 21.strings.h/cpp are here:

This is okay for now, btw., please go ahead and commit it. We
do need to enhance the test to exercise the common idiom used
to shrink a string object to 0 capacity:

         std::string s ("...");
         assert (0 < s.capacity ());

         std::string ().swap (s);
         assert (0 == s.capacity ());
     // check for memory leaks

I think the cases might already be there, I'm just not sure
I see where we check the capacity or for memory leaks.

In addition, when UserAlloc is ready for prime time, we need
to remember to enhance the test to exercise the function with
unequal allocators.


View raw message