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] std::string::operator[] extension in debug mode



On May 19, 2005, at 6:04 AM, Paolo Carlini wrote:
Thanks Jonathan for working on this and explaining in public the whole
thing! My plan would be returning to it in a couple of days, after
Chris' last batch of move semantics and the visibility long standing PR,
already in my queue. My impression is that changing the build options is
indeed unfortunately necessary, because, basically, string and wstring
are instantiated in the library (actually, I seem to remember that, in
order to work a bit on the operator[] issue without rebuilding I used
basic_string<short>). We have to carefully document this, in case.


But better also involving Doug, if possible. Doug can you possibly tell
us your take on this issue?

My knee-jerk reaction would be to do as Jon has said: turn off the extern templates in debug mode. It's an ODR violation, but in a sense the entire debug mode is one big ODR violation: we've taken names like std::vector and rerouted them to totally different implementations. The ODR violation doesn't cause problems because of strong using; we just need to ensure that turning off extern templates does the right thing. We might also want to mark operator[] with the "always_inline" attribute, so that we never get two conflicting definitions of the same code.


Doug


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