| 440 | // Find the position where value should be inserted in sorted range [first, last) |
| 441 | template <typename Iterator, typename T, typename Compare> |
| 442 | Iterator lower_bound_impl(Iterator first, Iterator last, const T& value, Compare comp) FL_NOEXCEPT { |
| 443 | auto count = last - first; |
| 444 | while (count > 0) { |
| 445 | auto step = count / 2; |
| 446 | Iterator it = first + step; |
| 447 | if (comp(*it, value)) { |
| 448 | first = ++it; |
| 449 | count -= step + 1; |
| 450 | } else { |
| 451 | count = step; |
| 452 | } |
| 453 | } |
| 454 | return first; |
| 455 | } |
| 456 | |
| 457 | // In-place merge operation for merge sort (stable sort) |
| 458 | template <typename Iterator, typename Compare> |
no outgoing calls
no test coverage detected