[function] How to get boost::function parameters, return type.

Hi, Is it possible to decompose boost::function into it's "constituent" parameters and return type, a la Boost.FunctionTypes? Thanks, Mostafa

2011/4/12 Mostafa
Hi,
Is it possible to decompose boost::function into it's "constituent" parameters and return type, a la Boost.FunctionTypes?
http://www.boost.org/doc/libs/1_46_1/libs/type_traits/doc/html/boost_typetra... Is this what you want?

On Tue, 12 Apr 2011 00:45:34 -0700, TONGARI
2011/4/12 Mostafa
Hi,
Is it possible to decompose boost::function into it's "constituent" parameters and return type, a la Boost.FunctionTypes?
http://www.boost.org/doc/libs/1_46_1/libs/type_traits/doc/html/boost_typetra...
Is this what you want?
Unfortunately not, that only works on "function types", the type of boost::function is some unspecified struct/class. Mostafa

On 4/11/2011 1:27 PM, Mostafa wrote:
Hi,
Is it possible to decompose boost::function into it's "constituent" parameters and return type, a la Boost.FunctionTypes?
Sure! You can use function_types on the Signature that function was instantiated with: http://www.boost.org/doc/libs/1_42_0/libs/function_types/doc/html/boost_func... You can also access the member types within the function: http://www.boost.org/doc/libs/1_42_0/doc/html/boost/functionN.html

On Tue, 12 Apr 2011 09:50:33 -0700, Noah Roberts
On 4/11/2011 1:27 PM, Mostafa wrote:
Hi,
Is it possible to decompose boost::function into it's "constituent" parameters and return type, a la Boost.FunctionTypes?
Sure!
You can use function_types on the Signature that function was instantiated with:
http://www.boost.org/doc/libs/1_42_0/libs/function_types/doc/html/boost_func...
You can also access the member types within the function: http://www.boost.org/doc/libs/1_42_0/doc/html/boost/functionN.html
Thanks, I did consider that. But I am/was only interested in boost::function, because for some now forgotten (and maybe erroneous) reason I'd concluded that I did not have access to the signature that it was instantiated with. Mostafa
participants (3)
-
Mostafa
-
Noah Roberts
-
TONGARI