Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost.bind] How to retrieve the function type of aboost::bind result
From: Peter Dimov (pdimov_at_[hidden])
Date: 2009-01-27 10:25:54


Olaf Krzikalla:

> template<class T, class U>
> struct arity_dispatch< boost::function<void(T, U)> >
> {
> static void call(const boost::function<void(T, U)>& f)
> { f(getArg<T>(0), getArg<T>(1)); }
> };

Why not dispatch on the number of arguments that are available via getArg?
You won't then need to know the arity of the function object (assuming it
has one and only one arity, which it may not.)


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