c++ - How to declare a pointer to a function of return type X and input parameter A? -


what general form of declaring pointer function which, of return type x , accepts input parameter &y?

is it:

x my_function(y &y){     //code }  x (*my_pointer) (y &y) = my_function; 

?

x (*fptr)(y&) = my_function; 

or:

auto fptr = my_function; // c++11 

or:

std::function<x(y&)> fptr(my_function); // c++11, boost::function if not 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -