I see a false positive running cppcheck 2.22.0 against the following code. Note the parameter cannot be declared as reference to const because its job is to match both const and mutable references, and return a reference to a member which retains the const-ness of the first argument (similar to the 'deduce this' pattern). The static asserts demonstrate the intended use cases. Note also that the false positive goes away if the concept is inlined as a template requires clause on the function itself...
I see a false positive running cppcheck 2.22.0 against the following code. Note the function itself cannot be static because it's an explicit member function (deducing this). #include <array> #include <cstddef> #include <ranges> #include <span> constexpr std::size_t GridSize{19}; class board { public: auto rows(this auto&& self) { auto* cells = self.data.data(); return std::views::iota(0zu, GridSize) | std::views::transform([cells](std::size_t row) { return std::span{cells + row * GridSize, GridSize};...