This is the mail archive of the
mailing list for the libstdc++ project.
Re: [patch] Remove invalid test on non-const empty strings
- From: Chris Jefferson <caj at cs dot york dot ac dot uk>
- To: Jonathan Wakely <cow at compsoc dot man dot ac dot uk>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Fri, 21 Jan 2005 10:49:50 +0000
- Subject: Re: [patch] Remove invalid test on non-const empty strings
- References: <41F01164.firstname.lastname@example.org> <20050121104028.GB776@compsoc.man.ac.uk>
Jonathan Wakely wrote:
>I reported these as http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16021
On a related note, there are a bunch of tests to check that the
specialisations of swap work. These don't appear to work on the
Ah, this bug is already submitted. I should have looked for that. Sorry!
Well, I could overload both copy constructor and assignment then :)
debugging library, and also make me nervous as they are adding overloads
of member functions of elements of std. It seems their purpose is to
check that the O(1) swap is being called. Wouldn't therefore something like:
Test the same thing, and not require adding overloads?
They're specialisations, not overloads, so are absolutely fine. It's
legal to add specialisation to namespace std for stdlib components
with user-defined types as template arguments. The point is to test
that std::swap<std::deque<T> >() calls std::deque<T>::swap(), which I
don't think your code above does - it assumes that the default
specialisation of std::swap() will cause copies of the elements, but
it's possible it could be implemented purely in terms of assigments
(however unlikely that may be).
If adding overloads to std is valid however then really the test / code
needs fixing anyway, as you say, as this is something which can legally
be done. I am somewhat suprised people are allowed to add overloads
here, but if thats what the standard says, so be it!