I have an stl functional std::function<int(int,int)> fcn_
as a member field of a class. Is there a way to serialize it using boost serialization? If I do the following
template<class Archive>
void serialize(Archive &ar, const unsigned int version) {
ar & fcn_;
}
I got the error
/opt/local/include/boost/serialization/access.hpp:118:9: error: 'class std::function<int(int, int)>' has no member named 'serialize'
Is there a header file (say something like<boost/serialization/vector.hpp>
) I can include that implements serialize
for std::function
? Or is there an easy way to implement one myself?
Thanks!