Sign in to follow this  
dave

Function Pointer

Recommended Posts

dave    2187
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
dave    2187
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
Telastyn    3777
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

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