
22 Aug
2007
22 Aug
'07
2:53 p.m.
From: Robert Kawulak
struct is_even { bool operator () (int i) const { return (i % 2) == 0; } } is_even_fn;
Actually, this could even be bool is_even_fn(int i) { return (i % 2) == 0; }
constrained< int, boost::function1<bool, int> > c(is_even_fn);
Now I'm thinking about making boost::function1 the default parameter of constrained, so you could just write constrained<int> c(is_even_fn); Looks good, doesn't it: :D Best regards, Robert