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]

[RFC] On the uses of less<>() in basic_string


Hi Nathan, hi everyone,

I'm going again through the uses of those function objects in
basic_string.

At the time, Nathan (I seem to remember) suggested that because
of portability issues wrt comparing pointers not pointing both
inside the same _Rep.

Now I'm not really convinced anymore, however. I'm under the
impression that those uses artificially block some simplifications
since the code has to distinguish the case of pointers pointing
both inside the same _Rep (which can be compared with '<') and the
case of pointers not pointing inside the same _Rep.

I'm not convinced because we are seemingly so careful but then,
when we have to actuall copy data around (from anywhere to the
_Rep, for instance) we end up using plain traits::copy and move,
that is, plain memcpy and memmove, eventually...

So, what's that really about? How are we supposed to move 'safely'
data around in a way consistent with the function objects?

Coming next to low level issues, I'm not really sure that those
function objects are full optimized by the present compiler. I
remember some remarks from Gaby about planned improvements to the
implementation which probably should address this issue too.

Gaby, can you possibly update us about that?

Thanks,
Paolo.


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