
Steven Watanabe wrote:
Which gives a similar (though less unresolved) error-message:
error: no matching function for call to 'neg(bool (&)(int))'
neg(&foo) might work better.
I tried that too. The error is: error: no matching function for call to 'neg(bool (*)(int))'
Hm. That's not exactly pretty. I'd rather use boost::bind itself on the call site. I was hoping to be able to fix something in the definition of neg instead.
Does it work if you make the argument to neg bool (*f)(const std::string&)?
Yes. Both: function<bool (string)> neg(bool(*func)(const string&)) and function<bool (string)> neg(function<bool (string)> func) work as expected. But you understand why I'd like the templated version to work. I have other predicates to test. -- Michiel Helvensteijn