[patch] std::string::operator[] extension in debug mode

Gabriel Dos Reis gdr@integrable-solutions.net
Thu May 19 19:26:00 GMT 2005


Jonathan Wakely <cow@compsoc.man.ac.uk> writes:

| On Thu, May 19, 2005 at 08:04:31PM +0200, Gabriel Dos Reis wrote:
| 
| > A question I have is why conditionalizing the extern template stuff on
| > debug does not work.
| 
| Because the lib was not built with debug, so the extern template
| instantiation (sans assertions) is always in the lib.

If the lib was not build with debug and user wants to use it as with
debug support, then user is in trouble he/she asked for.

|  If you disable
| extern templates your .o file includes an implicit instantiation (with
| assertions). 

I think I understand that part.

| When you link to the lib you get ODR.

But you don't have to put it in the non-debug lib.

-- Gaby



More information about the Libstdc++ mailing list