Updating nth_element for C++0x

Christopher Jefferson caj@cs.st-andrews.ac.uk
Sun Aug 23 17:33:00 GMT 2009


Hello,

I'm found myself able to spend time on libstdc++ again, and so am  
intending on working on finishing <algorithm> for C++0x, in particular  
sort and associated algorithms.

This first patch touches various pieces of code, but it's main benefit  
is it makes nth_element work with move-only types. I have a couple  
more patches in the pipeline, but am trying to put things into smaller  
pieces. I haven't submitted any patches for a while, I hope I've got  
the various formatting bits right.

Thanks, Chris

2009-08-23  Chris Jefferson <chris@bubblescope.net>
	include/stl_algo.h (__move_median_to_front): Add new method
	to ease sorting move-only types.
	(__unguarded_linear_insert) : Assume always inserting value
	at __last.
	(__insertion_sort, __unguarded_insertion_sort) : Update for
	 move-only types.
	(__unguarded_partition) : Take pivot by reference.
	(__unguarded_partition_pivot) : Add new method for sorting
	move-only types.
	(__introsort_loop, __introselect) : Use
	__unguarded_partition_pivot.
	testsuite/25_algorithms/nth_element/moveable.cc : Enable.



-------------- next part --------------
A non-text attachment was scrubbed...
Name: nth_element_patch
Type: application/octet-stream
Size: 10305 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20090823/9c4d31ac/attachment.obj>


More information about the Libstdc++ mailing list