This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] Remove invalid test on non-const empty strings
Paolo Carlini wrote:
chris jefferson wrote:
Good point!
Perhaps then a better idea would be to wrap tests like this in a
#ifndef _GLIBCXX_DEBUG / #endif pair?
Better, but I think we should really understand (I'm speaking for
myself, first and foremost ;) why the debug mode is so strict about
that behavior...
Hmm.. I'm not sure what you mean. If you mean why does it pass in the
const case, and not in the non-const case, I'd guess thats because that
exactly how it is written in debug/string :) (there is a different
implementation of [] for const and non-const, with the different
requirements.)
I suppose what this really depends on is what the aim of the debugging
library is. I had at first assumed that it's purpose was exactly what it
says, a libstdc++ debugging library. However in this case it looks more
like it is aiming to be a super-pedantic library. One option would be to
introduce an extra "pedantic" mode.. however I'm not convinced how
useful that would be in the long run, as I suspect properly implementing
such a thing would require a lot of extra code, so perhaps we should
just nuke this extra test in string?
Chris