I would like to serialize a boost::array, containing something that is already serializable.
If get this error:
error C2039: 'serialize' : is not a member of 'boost::array<T,N>'
I have tried to include the serialization/array.hpp header but it did not help.
Is there another header to include ?
Thanks
EDIT:
Removed a wrong link
You need to show the code for the class contained in the boost::array. Since boost::array is STL-compliant, there should be no reason that this would not work. You should be doing something like the bus_route and bus_stop classes in this example.
The class contained in the boost::array must declare boost::serialization::access as a friend class and implement the serialize method as below:
Once that is done, a std container should be able to serialize the bus_stop:
Note the important line:
Which will automatically iterate through the std container, in this case a std::list of bus_stop pointers.
The error:
Indicates that the class contained in the boost::array either has not declared boost::serialization::access as a friend class or has not implemented the template method serialize.