55
edits
Changes
→Standard Template Library
These algorithms provide a ''functional'' way to work on collections, and are very common in several programming languages.
<pre><code>
#include <iostream>
#include <algorithm>
cout << "== FINDING AN ELEMENT ==" << endl;
vector<<int>::iterator elFound = find_if(myVector.begin(), myVector.end(), [](int i) { return i > 4 && i % 6 == 0; });
cout << "The element " << *elFound << " is the first that satisfies i > 4 && i % 6 == 0" << endl << endl;
return 0;
}
</code></pre>
<pre style="color: red">
What algorithms are provided?
</pre>
== MCSTL ==