[patch] std::string::operator[] extension in debug mode
Jonathan Wakely
cow@compsoc.man.ac.uk
Thu May 19 15:00:00 GMT 2005
On Thu, May 19, 2005 at 03:43:06PM +0200, Paolo Carlini wrote:
> I'm not 100% sure to follow your reasoning here: actually, this specific
> issue (debug-mode vs string) is *not* limited to operator[]... This
> thread started with that subtle issue about the v3 extension, then
> Jonathan moved to the much more general problem with debug-mode
> basically not active for basic_string<char> and basic_string<wchar_t> ,
> being the latter instantiated in the library. We have *a lot* of
> _GLIBCXX_DEBUG_* and I'm not sure we can enforce inlining for all of
> them... If this is *really* a requirement from the ODR point of view,
> I'm not sure, on the spot: I'd like to hear the opinion of the list...
As Doug said, the whole debug mode is a non-standard hack.
(I mean that in the best possible way - I think it's bloody great!)
I think if it breaks a few rules of the standard but works as expected
everyone will be happy. Even if there are some ODR problems found I
doubt we'll get many angry users complaining about occasional link
problems, since using debug mode for anything but debugging and testing
would be silly.
The important thing is that debug mode never interferes with normal
mode. As long as that's true debug mode has a fair bit of freedom to
be "creative" with the standard.
Just my opinion, of course.
jon
--
"A well-written program is its own heaven
A poorly written program is its own hell"
- The Tao of Programming
More information about the Libstdc++
mailing list