File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ namespace clang::tidy::readability {
19
19
// /
20
20
// / The emptiness of a container should be checked using the `empty()` method
21
21
// / instead of the `size()`/`length()` method. It shows clearer intent to use
22
- // / `empty()`. Furthermore some containers may implement the `empty()` method
23
- // / but not implement the `size ()` or `length()` method. Using `empty ()`
24
- // / whenever possible makes it easier to switch to another container in the
25
- // / future.
22
+ // / `empty()`. Furthermore some containers (for example, a `std::forward_list`)
23
+ // / may implement the `empty ()` method but not implement the `size ()` or
24
+ // / `length()` method. Using `empty()` whenever possible makes it easier to
25
+ // / switch to another container in the future.
26
26
class ContainerSizeEmptyCheck : public ClangTidyCheck {
27
27
public:
28
28
ContainerSizeEmptyCheck (StringRef Name, ClangTidyContext *Context);
Original file line number Diff line number Diff line change @@ -9,9 +9,10 @@ with a call to ``empty()``.
9
9
10
10
The emptiness of a container should be checked using the ``empty() `` method
11
11
instead of the ``size() ``/``length() `` method. It shows clearer intent to use
12
- ``empty() ``. Furthermore some containers may implement the ``empty() `` method
13
- but not implement the ``size() `` or ``length() `` method. Using ``empty() ``
14
- whenever possible makes it easier to switch to another container in the future.
12
+ ``empty() ``. Furthermore some containers (for example, a ``std::forward_list ``)
13
+ may implement the ``empty() `` method but not implement the ``size() `` or
14
+ ``length() `` method. Using ``empty() `` whenever possible makes it easier to
15
+ switch to another container in the future.
15
16
16
17
The check issues warning if a container has ``empty() `` and ``size() `` or
17
18
``length() `` methods matching following signatures:
You can’t perform that action at this time.
0 commit comments