[PATCH] D24349: [clang-tidy] Extend readability-container-size-empty to arbitrary class with size() and empty()

Gábor Horváth via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 8 13:24:57 PDT 2016

xazax.hun added a comment.

In https://reviews.llvm.org/D24349#537594, @omtcyfz wrote:

> In https://reviews.llvm.org/D24349#537589, @Eugene.Zelenko wrote:
> > If size() and empty() change object's state, it may be not equivalent replacement.
> True. But my point is that they are not required to do that if they're just not marked `const`.

I agree with Eugene. But I think a good consensus could be to warn on the non-const case but do not do the rewrite. What do you think?



More information about the cfe-commits mailing list