Skip to content

Commit

Permalink
allow loop vectorization
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobiasd committed Apr 11, 2014
1 parent f35da84 commit 348805f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions from_goto_to_std-transform.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ This is much easier than decyphering a for loop every time.
## Range-based for vs. [`<algorithm>`](http://en.cppreference.com/w/cpp/algorithm)
A for loop also beginning with `for (int i : v)` could do something totally unrelated to `std::transform`. E.g. it could implement a filter:
```c++
vector<int> result;
for (int i : v)
{
if (i % 2 == 0)
Expand Down

0 comments on commit 348805f

Please sign in to comment.