diff options
author | Niels Dekker <N.Dekker@lumc.nl> | 2024-12-02 23:45:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-03 06:45:06 +0800 |
commit | da5f330e84d74aeacdbb801c46282b9eebec6793 (patch) | |
tree | 3dc913ec8a095c6b339e719210e0988ec34b3665 /llvm/lib | |
parent | 33faa8285f3dc5ca10e35770b288770b4bbc2bc1 (diff) | |
download | llvm-da5f330e84d74aeacdbb801c46282b9eebec6793.zip llvm-da5f330e84d74aeacdbb801c46282b9eebec6793.tar.gz llvm-da5f330e84d74aeacdbb801c46282b9eebec6793.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib')
0 files changed, 0 insertions, 0 deletions