
5 Jul
2010
5 Jul
'10
6:18 p.m.
Jeffrey Lee Hellrung, Jr. wrote:
You can, however, get away with querying whether a function object can be called with a specific signature, though the machinery to do this is relatively complex. I think something working is found in Boost.Proto as "can_be_called". If the functor follow the result_of protocol, a traits can be made to test if a functor F can be called with arguments A0,..,An with a syntax like can_be_called<F(A0,...,An)>
Here is a sample implementation: http://codepad.org/H5CtU5sa