Sign in to follow this  

Function pointers, C++

This topic is 3578 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

What can function pointers point to in C++? Which of the following would work: - static member of a class - member function of a specific object - the static-type virtual member function of a specific object - the dynamic-type virtual member function of a specific object

Share this post


Link to post
Share on other sites
Quote:
Original post by all_names_taken
- static member of a class


Yes.

Quote:
- member function of a specific object
- the static-type virtual member function of a specific object
- the dynamic-type virtual member function of a specific object


No. However, boost::bind could help you achieve this.

Share this post


Link to post
Share on other sites
Quote:
Original post by ToohrVyk
Quote:
- member function of a specific object
- the static-type virtual member function of a specific object
- the dynamic-type virtual member function of a specific object


No. However, boost::bind could help you achieve this.


Well, it'll help you store references to the above in, say, a boost::function, but it doesn't really help with a raw function pointer itself.

Share this post


Link to post
Share on other sites

This topic is 3578 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this