Last active
October 6, 2017 11:02
-
-
Save deque-blog/a4337ea2dec26cc2e1631663572378fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template<typename T, typename Consumer> | |
void for_each( | |
typename std::vector<T>::const_iterator first, //dependent type on T | |
typename std::vector<T>::const_iterator last, //dependent type on T | |
Consumer consumer) | |
{ | |
for (;first != last; ++first) | |
consumer(*first); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment