Skip to content

Feature/indexed for each#230

Open
denzor200 wants to merge 5 commits intoboostorg:developfrom
denzor200:feature/indexed_for_each
Open

Feature/indexed for each#230
denzor200 wants to merge 5 commits intoboostorg:developfrom
denzor200:feature/indexed_for_each

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