templates - In C++, how can I get an arbitrary function's type from its declaration? -


possible duplicate:
extract return type of function without calling (using templates?)

starting (provided else):

int my_function(int, int *, double); 

i want this:

typedef boost::function_types::result_type< my_function_type >::type my_result; typedef boost::function_types::parameter_types< my_function_type >::type my_parameters; 

how my_function_type?

note: know boost_typeof(), seems bit scary, in "perhaps not totally portable"?

decltype. examples:

char foo(int) {} decltype (foo(3)) const *frob = "hello foo"; typedef decltype (foo(3)) typeof_foo; using typeof_foo = decltype(foo(3)); 

the expression decltype evaluated @ compile time , must resolvable. pass constexpr integer it.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -