Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/indexed for each #230

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

denzor200
Copy link
Contributor

This patch extends for_each algorithm, implements a small and useful С++11 functional. For example:

typedef vector<int, char, double, char const*> vector_type;
vector_type v(1, 'x', 3.3, "Ruby");
for_each(v, [](const auto& v, int i){
    std::cout << "[ " << i <<  " : " << v << " ] ";
});
std::cout << std::endl;

The index value is also available at compile time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant