
Hello, Is it possible to serialize the following class: struct foo { void f1(int a) {} void f2(const std::string& s) {} void init() { using boost::bind; functors_.push_back(bind(&foo::f1, this, 1)); functors_.push_back(bind(&foo::f2, this, "test")); } std::vector<boost::function<void(void)> > functors_; }; That is, I'd like save the functors, in order to run them later, when the object is loaded from the archive. A straightforward attempt fails: struct foo { //...... friend class boost::serialization::access; template<class Archive> void serialize(Archive &ar, const unsigned int version) { ar & BOOST_SERIALIZATION_NVP(functors_); } }; 1>d:\dev\servision\projects\windows\thirdparty\boost\boost\serialization\access.hpp(109) : error C2039: 'serialize' : is not a member of 'boost::function<Signature>'