Function Pointer

Started by
2 comments, last by SiCrane 18 years, 5 months ago
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
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
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.
The type of the pointer is void (consolemsg:: *)(eventData *).

This topic is closed to new replies.

Advertisement