This is the mail archive of the
mailing list for the GCC project.
Re: [patch] : Add move symantics to more of libstdc++
- From: chris jefferson <caj at cs dot york dot ac dot uk>
- To: Paolo Carlini <pcarlini at suse dot de>
- Cc: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 16 May 2005 20:11:56 +0100
- Subject: Re: [patch] : Add move symantics to more of libstdc++
- References: <4288DBAE.email@example.com> <4288E14E.firstname.lastname@example.org>
Paolo Carlini wrote:
chris jefferson wrote:Yup :)
This patch makes remove, remove_if, rotate and the heap functions move
aware. It also tidies up some swaps to iter_swap, and adds a test case
or two and a couple of testcases fixes. Has been carefully designed so
that it will have no effect on the performance of non move-aware types
(in particular the built in types).
This patch does do a number of small things at the same time, if you'd
like it splitting into patches which each only do one thing, I'll do that.
I think it's rather understandable as-is, thanks. I'm going to look into
it, regtest again on my side, and so on. I'll let you know how it goes
and in case everything is ok, we can go ahead, as usual.
Two quick comments:
1- ALISING should be intended as ALIASING, right?
I've been checking with my own work against n1771, which lists the
suggested requirements for each algorithm. I agree with them :)
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:
- unique (done!)
- rotate (done!)
- partition (done!)
Partition in fact only uses swap, so it was already optimised. Remove is
also done with this new submission, as is heap sort. 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).