The following program works on g++ 4.4 when IsOdd is a struct and does not compile when IsOdd is a class. The error message (partial) is
/usr/include/c++/4.4/bits/stl_function.h:102: error: ‘typedef int std::unary_function<int, bool>::argument_type’ is inaccessible
Code:
#include<iostream>
#include<vector>
#include<functional>
#include<algorithm>
using namespace std;