[patch] : Add more symantics to sort, partial_sort, nth_element
chris jefferson
caj@cs.york.ac.uk
Tue Jun 7 10:28:00 GMT 2005
Paolo Carlini wrote:
>chris jefferson wrote:
>
>
>
>>Exactly what it says in the title. This is the non-contraversal part
>>of the patch I sent last week. I'm still tidying up the other half.
>>
>>
>
>Ok, I'm going to apply to v7 the patch basically as-is, besides a few
>trivial reformattings and missing std:: qualifications: passes
>regtesting, and looks basically sane. Also, v7 is for experimental code
>and we can afford a little bit of risk, for now. I will study the code
>in better detail over the next days, anyway.
>
>
>
(Famous last words) I feel fairly confident about all the code from an
algorithmic viewpoint (I've stepped through it all in a debugger),
although it's not totally impossible (I'm fairly confident however) that
I haven't accidentally made a slight assumption I'm not permitted to
use. I've been finding it fairly hard to find big pieces of C++ code
which really push the standard library to be sure.
Sorry about the qualifications...
>However, a *necessary precondition* for even envisaging merging to
>mainline this code, is documentation on top of the new helper functions
>(like __introsort_partition for moveable, __unguarded_*). I know that
>comments are also lacking on top of some HP/SGI functions but we don't
>want to follow forever those bad examples ;) We are risking maintainance
>nightmares, otherwise.
>
>
>
Yes, I should have documented that.. sorry. I'm going to take the time
to step back and do a bit of cleaning now I think, before submitting
stable_sort / inplace_partition (which are quite intrusive).
>Also, a trivial patch replacing everywhere __is_moveable::value with
>__value is *very* welcome: user code *can* define a value macro, remember.
>
>
>
It looks like I don't have to now :) But sorry, I should still have done
this some time ago!
Chris
More information about the Libstdc++
mailing list