Boost logo

Boost :

Subject: Re: [boost] [Algorithm] Incorrect behavior of is_sorted_until (predicate version)
From: Marshall Clow (mclow.lists_at_[hidden])
Date: 2012-07-11 23:02:37

On Jul 11, 2012, at 4:53 PM, Michel Morin wrote:

> Hi Marshall,
> Suppose we have an array
> int ar[5] = {1, 2, 2, 2, 2};
> Then, `is_sorted_until(ar, ar + 5, std::less<int>())` should return
> `ar`'s end pointer. But it gives `ar + 2`.

Thanks for the bug report.
Originally, I thought that you were mistaken; the code is doing exactly what I intended it to do.

Eventually, I came around to your point of view; my code was correctly written, but my understanding of what it should do was lacking.

I'll try to fix it tonight.


-- Marshall

Marshall Clow Idio Software <mailto:mclow.lists_at_[hidden]>

A.D. 1517: Martin Luther nails his 95 Theses to the church door and is promptly moderated down to (-1, Flamebait).
        -- Yu Suzuki

Boost list run by bdawes at, gregod at, cpdaniel at, john at