File: README-foreach.md

package info (click to toggle)
clazy 1.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,248 kB
  • sloc: cpp: 23,552; python: 1,450; xml: 450; sh: 237; makefile: 45
file content (10 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
# foreach

- Finds places where you're detaching the `foreach` container.
- Finds places where big or non-trivial types are passed by value instead of const-ref.
- Finds places where you're using `foreach` on 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