I create something like a list of functors (functions pointers). Then I write them in binary form into file. The problem is, that, functor – is a simple function pointer. (correct me if I’m wrong.) But the address of function is different from one run to another.
So, the question – is there any way to create list of functors that will be relevant all the time?
I’d recommend some kind of paired data structure with an identifier on one side and the function pointer on the other. If there are enough of them something like a map:
Your application should build this map when it is first needed and cache the result. Then when you “write” the function pointers to a file, you should write the unique std::string keys instead. When the application “reads” the function pointers it will read in the keys and map them to the function pointers for that invocation of the program.