
16 Jul
2008
16 Jul
'08
11:31 p.m.
AMDG Michiel Helvensteijn wrote:
But you understand why I'd like the templated version to work. I have other predicates to test
Ok. The compiler can't deduce T in template <class T> function<bool (T)> neg(function<bool (T)> func); unless the argument is already a boost::function. No implicit conversions allowed. template<class F> struct not_t { typedef bool result_type; template<class T> bool operator()(const T& t) { return(!f(t)); } F f; }; template<class F> not_t<F> neg(F f) { not_t<F> result = { f }; return(result); } In Christ, Steven Watanabe