User Activity

  • Posted a comment on discussion General Discussion on cppcheck

    Hello Using Cppcheck-2.21.0 I get a warning here: #include <algorithm> #include <cassert> #include <vector> int main() { std::vector<int> v { 1, 1, 2, 3, 3 }; std::ranges::sort(v); v.erase(std::ranges::unique(v).begin(), v.end()); assert((v == std::vector<int> { 1, 2, 3 })); } warning: Iterators to containers from different expressions 'std::ranges::unique(v)' and 'v' are used together. [mismatchingContainerExpression] v.erase(std::ranges::unique(v).begin(), v.end()); ^

View All

Personal Data

Username:
pontus-eriksson
Joined:
2026-07-09 16:56:41.600000

Projects

  • No projects to display.

Personal Tools

Auth0 Logo