Angus Leeming <[EMAIL PROTECTED]> writes:

| Lars Gullik Bjønnes wrote:
>
>> Cleaning up my numerous lyx trees I found this.
>> 
>> What where the objections again?
>
| That we're in a freeze? I believe that the general criticism last time
| round was that you were just fiddling. Changing working code for the sake
| of it. That the new code is neither better nor worse than the old code,
| just less familiar.
>
| Maybe things have changed since then.
>
| Personally, I fail to see why this:
| -       std::sort(bibkeys.begin(), bibkeys.end(), compareNoCase());
| is worse than this:
| +       // Do a no-case-sensitive sort
| +       std::sort(bibkeys.begin(), bibkeys.end(),
| +                 bind(less<int>(),
| +                      bind(compare_ascii_no_case, _1, _2),
| +                      0));

But what you really are trying to say is:

    Personally, I fail to see why this:

    -namespace {
    -
    -// A functor for use with std::sort, leading to case insensitive
    -sorting
    -struct compareNoCase: public std::binary_function<string, string, bool>
    -{
    -       bool operator()(string const & s1, string const & s2) const {
    -               return compare_ascii_no_case(s1, s2) < 0;
    -       }
    -};
    -
    -} // namespace anon
    -
    -
    -       std::sort(bibkeys.begin(), bibkeys.end(), compareNoCase());
    is worse than this:
    +       // Do a no-case-sensitive sort
    +       std::sort(bibkeys.begin(), bibkeys.end(),
    +                 bind(less<int>(),
    +                      bind(compare_ascii_no_case, _1, _2),
    +                      0));


Something about the whole picture...

-- 
        Lgb

Reply via email to