This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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] : Add move symantics to more of libstdc++


chris jefferson wrote:

>> 2- I have a rough list of algorithms which can internally exploit
>> efficient moves (courtesy of Howard Hinnant ;). I would guess the same
>> is true for our simulated move-semantics, as far as containers of
>> containers are concerned:
>> - remove
>> - unique (done!)
>> - rotate (done!)
>> - sort
>> - stable-sort
>> - heap-sort
>> - partition (done!) 
>
> I've been checking with my own work against n1771, which lists the
> suggested requirements for each algorithm. I agree with them :)
>
> Partition in fact only uses swap, so it was already optimised. Remove
> is also done with this new submission, as is heap sort.

Yes, sorry, remove and heap-sort also.

> The main work left revolves around the merging and sorting algorithms,
> which all use each other and the same set of internal algorithms .
> This requires a) move-aware allocators (which aren't actually very
> hard) and figuring out how to change __unguarded_partition without
> causing a loss of efficency for other types.
>
> Once this is done (and in particular the move-aware allocators), then
> it should be easy to also fix the containers themselves (ie
> reallocating deque and vector).

Great. Thanks for the nice summary.

We have also to start thinking about basic_string. N1377 and N1699 are
definitely very interesting about that. All in all, if we move away from
reference_counting, probably some additional complexity is worty,
performance-wise, while waiting for C++0x, which is still a few years
away (not to mention the actual implementation of the compiler bits).
I'd appreciate your feedback about the basic_string applications, I'm
not sure how *much* simulated move semantics we really want there.

Paolo.


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