
6 May
2010
6 May
'10
5:43 p.m.
Currently, can_be_called<> expects only functors. Is it possible to extend it so that it can take any type and return true if that type can be called with the list of given parameters. For example, function<int (int, char, long)> functor; int f(int, char, long); int dummyInt; int main(int argc, char ** argv) { assert(false == test(functor, argc, 11, argv)); assert(true == test(functor, 10, 11, 12)); assert(true == test(f, 10, 11, 12)); assert(false == test(dummyInt, 1)); } Thanks, Andy.