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: Implementing clean and simple move symantics


Martin Sebor wrote:

Chris Jefferson wrote:
...

Hmm.. I'll have to think about this a bit. In actual fact, I think all of the standard containers look like they can be moved by memmove,


I'm not sure about your implementation but ours stores the allocator
object in the container and in the rare case when the allocator has
non-trivial state the container may not be movable. But I haven't
been following this whole thread and you may have already discussed
this case and dealt with it. In that case, sorry about butting in :)

Hmm.. in the current vector::swap, when we swap two vectors we don't swap their allocators if their allocators are of the same type... could this be wrong / bad?


You are right however. The easy fix for this is to not optimise for people who use non-standard allocators. Out of interest, how frequently do people actually use non-standard allocators? (I can't say I've seen one, but I haven't seen that much C++ code.)....

Chris


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