Issue 146086
Summary [clang-tidy] feature request: modernize-use-range should include swap
Labels clang-tidy
Assignees
Reporter justusranvier
    Part of modernizing a project to use ranges includes replacing uses of `std::swap` or instances of the ["std 2-step"](https://stackoverflow.com/a/68516678) pattern with calls to `std::ranges::swap`.

Example:

```
std::swap(a, b);
```
or

```
using std::swap;
swap(a, b);
```

can both be replaced with:

```
std::ranges::swap(a, b);
```

In the latter case an unqualified call to `swap` should only be flagged if `using std::swap;` is present in the same scope before the call.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to