Is it possible to find the return type of a boost::function from it's typedef?

131 Views Asked by At

Is it possible to find the return type of a boost::function purely from its typedef?

Example:

typedef boost::function<bool (int, float)> CallbackType1;
typedef boost::function<float (int, float)> CallbackType2;

How to find the return type of the above function types?

I'm not sure if using c++0x features will be possible in my target build system, but any solution is welcome.

Many Thanks Guys,
Sak

1

There are 1 best solutions below

0
On BEST ANSWER

Boost.Function has a typedef inside it called return_type that should do the trick:

typedef CallbackType1::result_type CallbackType1ReturnType;

No wizardry needed.