Jump to content
  • Advertisement
Sign in to follow this  
dave

Function Pointer

This topic is 4698 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

Hey, I don't use these often so it usually catches me out, simple question. What's wrong with the way im trying to create this type?

	map< unsigned int, void	(consolemsg::*pMem)( eventData* ed )>		grabbers;

I'm trying to store function pointers by an integer id. Thanks, ace

Share this post


Link to post
Share on other sites
Advertisement
I was just messsing and changed it to this, and it compiles...


map< unsigned int, void (consolemsg::*)( eventData* ed )> grabbers;


so is:

consolemsg::*


the consolemsg member pointer type?

ace

Share this post


Link to post
Share on other sites
Eh, I think so, but I don't think you need to name the parameter.

[slightly offtopic]
Personally, I find boost::function's ability to specify the type as a simple signature (function<void(eventData *)>) to really help in keeping things clear and easy to use.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!