[PATCH] [clang-tidy] Checker for inefficient use of algorithms on associative containers
alexfh at google.com
Mon Feb 16 06:37:37 PST 2015
I found two more issues with this check:
1. the fixes for map-like containers are wrong. The .begin() and .end() allow to iterate over values of the map, and .find() accepts a key. I don't know if there is a good fix for all cases where std::find-like algorithms are used on a map. Maybe just leave a warning without a fix?
2. the check can produce incompilable fixes if an algorithm receives a value of a different type than the type of the container's elements. See http://pastebin.com/5pkMLrZb for an example.
Would be nice if you could fix the issues.
More information about the cfe-commits