Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Complexity guarantees for algorithms are often expressed explicitly in numbers of operations, not time [1].

Edit: actually, nth_element is a great example here: https://eel.is/c++draft/alg.nth.element#5

The complexity requirements for container member functions are often more vague an implicit, but I believe those are also not expressed in terms of time either. It's some other implicitly implied operation. In [2] for example this operation is the construction of a single object.

[1] https://eel.is/c++draft/sort#5 [2] https://eel.is/c++draft/sequences#vector.cons-5

An other tangentially related part of C++ is <chrono>, but I do not think that there are strict requirements there for precision. At most there is monotonic requirement for steady_clock[3].

[3] https://en.cppreference.com/w/cpp/chrono/steady_clock



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

Search: