[function_traits] How to detect function arity for functors with member template?
I am interested in tag dispatching in a generic function depending on
whether the passed in argument is arity 1 or 2.
My problem is that I want to have a generic expectation operator that
is passed in a function to take the expectation over, and a
distribution for the integration. The expectation needs to support
both real and mixed-integer measures and functions. Consider the
following functions it should work with:
struct my_real_functor
{
template
AMDG jesseperla wrote:
I am interested in tag dispatching in a generic function depending on whether the passed in argument is arity 1 or 2.
My problem is that I want to have a generic expectation operator that is passed in a function to take the expectation over, and a distribution for the integration. The expectation needs to support both real and mixed-integer measures and functions. Consider the following functions it should work with: <snip>
------------------------------------------------------ I looked at boost function_traits but it doesn't work with member functors.... http://www.boost.org/doc/libs/1_39_0/libs/type_traits/doc/html/boost_typetra...
Any ideas on how best to implement this?
http://tinyurl.com/ktscp3 In Christ, Steven Watanabe
participants (2)
-
jesseperla
-
Steven Watanabe