I have a static pointer to function like the following in my class, but I’m not sure how to instantiate it:
class Foo{
private:
static double (*my_ptr_fun)(double,double);
};
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The same way you would initialize every other static member object in C++03:
Whatever you would need a static function pointer for anyway.
This is called
initialization.instantiationmeans something different in C++.