This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Remove invalid test on non-const empty strings


On Fri, Jan 21, 2005 at 10:41:51AM +0000, Chris Jefferson wrote:

> 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.

Yes, that's certainly how I regard it - like run-time concept checks
that identify anywhere you invoke non-standard behaviour, e.g.
invalidating iterators.

>                                                   One option would be to 
> introduce an extra "pedantic" mode..

There's already __GLIBCXX_DEBUG_PEDANTIC

Maybe the non-pedantic debug mode should be changed to allow this v3
extension, but refuse it in 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?

jon

-- 
"There is no governor anywhere. You are all absolutely free."
	- Cagliostro the Great
	  "The Schroedinger's Cat Trilogy" RAW


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]