Using pointers to member functions as indexes for a map

Hello,
I am working on saving and restoring a complex class to and from a txt file. I am stuck on trying to save a list of pointers to member functions of a different class. I wanted to do that by creating a map of pointers to member functions and corresponding names, but I`m having problems with comparing those pointers. There is no operator< function for comparing member functions, and I`m not sure if they would be the same each time the program is ran. Any suggestions?
Thanks.
Yeah, there isn't really a way to do that.
and I`m not sure if they would be the same each time the program is ran.


You should never rely on the memory address a pointer points to being the same from run to run.

I'm not completely clear on just what kind of class you are trying to save and restore, but this page here may provide some useful info on how to handle it:
http://www.parashift.com/c++-faq-lite/serialization.html
Topic archived. No new replies allowed.