#include "predicate.hpp" #include #include class foo { public: foo(int c): count_(c) {} bool greater_than(int g) { return count_ > g; } bool less_than(int l) { return count_ < l; } int count_; }; // a very trivial example. int main(int argc, char **argv) { foo(12); predicate::type lt(boost::bind(boost::mem_fn(&foo::less_than), _1, 90)); predicate::type gt(boost::bind(boost::mem_fn(&foo::greater_than), _1, 6)); predicate::type lt_and_gt(lt & gt); if(lt_and_gt(f)) { std::cout << "the foo is between 6 and 90" << std::endl; } return 0; }