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: Hunting for performance regressions in libstdc++


Howard Hinnant wrote:

>> By the way, a slightly pedantic remark even if correct, admittedly:
>> wouldn't be more correct in the pseudocode '<' instead of '<=', and
>> likewise '>' instead of '>='?
>
> Your comment is a little ambiguous as there are multiple pseudocode
> listings.  Did you mean all of them?  I've briefly glanced at all of
> them containing "<=" or ">=" and don't immediately see any errors. 
> However, I'm happy to look at a specific pseudocode listing in more
> detail.  I've certainly made errors before and I'm sure will again.

Actually I meant the pseudocodes in frames, sorry. Assuming the operator
in the pseudocode has the same meaning of the comparison operator that
the containers take, would be more correctly '<', for std::less, then
'>', when appropriate. For instance, the first one, case ignore hint if
wrong (suppose, for clarity of explanation on my part that p != begin &&
p != end) would be:

    if (x < *p && x > *(p - 1))
       insert x before p
    else
       insert x without hint

Paolo.


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