foreach
May 9, 2023 ยท View on GitHub
- Finds places where you're detaching the
foreachcontainer. - Finds places where big or non-trivial types are passed by value instead of const-ref.
- Finds places where you're using
foreachon STL containers. It causes deep-copy. Use C++11 range-loop instead.
Note: range-loop is preferred over foreach since the compiler generates less and more optimized code.
Use range-loop if your container is const, otherwise a detach will happen.
This check is disabled for Qt >= 5.9