This patch introduces a range-based adapter for std::for_each(), similar to other extensions to <algorithm>. It's intended to be used as a replacement for std::for_each() when the full range is easily available, thus making the code easier to understand. It could also be used as a replacement for range-based for loops, though it may be less of a win there.
It also switches cases within LLVM to use the new facilities.