Did not file bugreport on source forge yet, first I'dd like a confirmation please.
#include <iostream>
#include <vector>
#include <deque>
#include <iterator>
#include <algorithm>
using namespace std;
bool IsEven(int elem)
{
return elem%2 == 0;
} // end of IsEven
bool AbsLess(int elem1, int elem2)
{
return abs(elem1) < abs(elem2);
} // end of AbsLess
int main()
{
int Dummy[] = {11, 2, 3, 4, 5, 4, 3, 18, 1, 9, 10};
vector<int> v(Dummy, Dummy + sizeof(Dummy)/sizeof(*Dummy));
deque<int> d(v.begin(), v.end());
// count all 4's in the vector
int n4v = count(v.begin(), v.end(), 4);
cout << "We found " << n4v << " instances of 4" << endl;
int nEven = count_if(d.begin(), d.end(), IsEven);
cout << nEven << " elements are even." << endl;
int MinElement = *min_element(v.begin(), v.end());
int MaxElement = *max_element(d.begin(), d.end());
cout << "The minimum of the set is " << MinElement << " , and the maximum is " <<
MaxElement << endl;
// with our own compare function
// op(elem1, elem2) : return true if elem1 is less then elem2
int Dummy2[] = {2, 3, 4, 5, 6, 7, 8, -3, -2, -1, 0, 1, 2, 3, 4, 5};
deque<int> coll(Dummy2, Dummy2 + sizeof(Dummy2)/sizeof(*Dummy2));
cout << "minimum of the absolute values: " <<
*min_element(coll.begin(), coll.end(), AbsLess) << endl;
cout << "maximum of the absolute values: " <<
*max_element(coll.begin(), coll.end(), AbsLess) << endl;
return 0;
} // end of main
Now do the following : Search menu -> goto function.
3 functions turn up, but look at their return values !!! Each function prepends the return values of the functions in front of it.