Joel de Guzman <joel <at> boost-consulting.com> writes:
should be easy enough to detect. There is in fact something that you can use:
template <typename T> struct is_actor;
Thanks, that will be useful. But I also need to determine if the phoenix actor has an operator() that can be called with certain arguments. I will have a functor passed to my library that may be binary vs. trinary and I go down a different static code path depending on the case. Perhaps the detection of is_callable here is near impossible without SFINAE with expressions. But how about a simpler problem: double binary_func(double x, double y){return x;} double unary_func(double x){return x;} auto unary_f = bind(&unary_func, _1); auto binary_f = bind(&binary_func, _1, _2); auto binary_f2 = _1 + _2; static_assert(functor_arity<decltype(unary_f)>::value == 1, ""); static_assert(functor_arity<decltype(binary_f)>::value == 2, ""); static_assert(functor_arity<decltype(binary_f2)>::value == 2, ""); ... is there a way to get a count of placeholders in an actor, etc?