Boost logo

Boost Users :

From: Michiel Helvensteijn (m.helvensteijn_at_[hidden])
Date: 2008-07-16 19:13:28


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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net