================ @@ -18,10 +18,11 @@ namespace clang::tidy::readability { /// a call to `empty()`. /// /// The emptiness of a container should be checked using the `empty()` method -/// instead of the `size()` method. It shows clearer intent to use `empty()`. -/// Furthermore some containers may implement the `empty()` method but not -/// implement the `size()` method. Using `empty()` whenever possible makes it -/// easier to switch to another container in the future. +/// instead of the `size()`/`length()` method. It shows clearer intent to use +/// `empty()`. Furthermore some containers may implement the `empty()` method +/// but not implement the `size()` or `length()` method. Using `empty()` +/// whenever possible makes it easier to switch to another container in the +/// future. ---------------- N-Dekker wrote:
Thank you both for your approval, @HerrCai0907 and @carlosgalvezp. I'm considering to propose mentioning `std::forward_list` here, as it is _the_ one STL container that does not implement `size()`. But maybe first wait for this one (#118459) to get merged... https://github.com/llvm/llvm-project/pull/118459 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits