string/list ABI changes

Paolo Carlini paolo.carlini@oracle.com
Sat Mar 2 10:09:00 GMT 2013


Hi,

On 03/02/2013 12:07 AM, Jason Merrill wrote:
> On 12/15/2012 07:00 AM, Paolo Carlini wrote:
>> today I prepared a patch adding again a data member to std::list in
>> C++11 mode to implement the O(1) list::size() requirement of C++11. This
>> time of course using the new attribute, on std::list itself (not on
>> specific member functions as in std::complex, which you handled a few
>> weeks ago). Below you can find what I'm finishing testing, rather
>> straightforward stuff.
> Now that we're getting close to stage 1, I'd like to talk about this 
> some more so it has lots of time to mature before 4.9.  As I believe I 
> was saying before, I think we want the change to be based on a #define 
> rather than on the -std flag, so that C++98 and C++11 code stay 
> compatible with each other, and people that need compatibility with 
> older code can select the old ABI if they prefer.  And the library 
> should have definitions of both versions.
Then what about the rest, all the other things we want to change in the 
new ABI? There are C++11 related changes (eg, that additional virtual in 
time) + old issues we finally would be able to fix + things that in a 
new ABI we would have the leeway to do better. I'm not sure to 
understand whether, as I thought, for 4.9 we really want to globally 
break the ABI by default. On top of that providing some header-only 
older versions (of eg, std::list) seem easy, otherwise we would have to 
maintain forever two different ABIs at the same time, thus two different 
versions of a large portion (consider the interactions with locale too) 
of the library at the same time, something we never even attempted 
(personally I'm not sure I want to be a pioneer in this area ;)

Paolo.



More information about the Libstdc++ mailing list