You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[clang-tidy] Adjust size-empty doc because C++11 size() is constant-time (#117629)
From C++11, a conforming `size()` method is guaranteed to be a
constant-time function. `empty()` is not _generally_ more efficient than
`size()`. It might even be implemented in terms of `size()`.
----
Notes:
- Microsoft's STL had implemented `empty()` as `return size() == 0`,
until May 2021: https://github.com/microsoft/STL/pull/1836/files
- The time complexity of `size()` (specifically for `std::set`) was
discussed by the library working group in 2007-2009:
https://cplusplus.github.io/LWG/issue632
0 commit comments