Jack Bryan wrote:
Dear All,
I need to transfer some pointers from one process to another process on Open MPI cluster.
These pointers are members of a class.
They are like:
class myClass { double *; int *; double**; }
When I use serialize in boost , I got errors:
/boost/serialization/access.hpp:118: error: request for member âserializeâ in âtâ, which is of non-class type âdoubleâ
pointers to primitives are not serializable. The problem is that serializing pointers requires tracking to detect and manage duplicates. If tracker were implemented for doubles it would automatically track ALL the doubles - probably not what one would want. But the solution is easy. define your own double like this struct serializable_double { double m_d; serializable_double(d) : m_d {} ... } The above can be done automatically with BOOST_SERIALIZATION_STRONGTYPEDEF(serializable_double, double) now you can use class myClass { serializable_double m_sd; ... template<class Archive> void serialize(Archive &ar, const unsigned int version){ ar & m_sd; } }; this should work as one expects. Robert Ramey