
Sohail Somani wrote:
This is an interesting question which I think might be doable in an elegant
way.
// Suppose we have a few functions with the following signature void f(int);
struct function_object {
virtual void operator()(int) = 0;
};
// wrap in function objects
struct function_object_1 {
// overload function call operator
void operator()(int){
// do something
}
template<class Archive>
serialize(Archive &ar, const unsigned int version){
// serialize base class - just register relationship from derived to
base
ar & boost::serialization::base_object
Hi,
Is it possible to serialize function pointers? I'm trying to serialize this guy:
struct f { typedef void(*function_t)(); function_t the_ptr_; };
Thanks,
Sohail