Hacker News new | past | comments | ask | show | jobs | submit login

I've lost track of the thread, because I don't know what you are talking about. Who is saying what doesn't exist?

The lower_bound you pointed to takes start/end iterators defining the partially-ordered range to examine.

The linked-to essay and the Wikipedia take array + size.

These are different APIs.

The latter - which is what this thread is about, IMO - is easier to implement because the sizes are always non-negative.




random access iterators provide exactly the pointer into array semantics, with a difference type and jumping to a ___location in the range.

https://en.cppreference.com/w/cpp/named_req/RandomAccessIter...

they were conceived for c++'98 and transmogrified to a trait for c++20

the run time in GPs lower_bound link is log(n) for random access iterators and liner for non-random access.


Yes.

But how does that change my observation about the differences in the two APIs?




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: