Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

http://robot.kaist.ac.kr/haptics/chai3d-2.0.0_Doc/resources/html/structc_matrix3d.html

cMatrix3d has a class data member double m [3][3];

Now correct me if I am wrong : to serialise an instance of this class I need to just add this

private:
    friend class boost::serialization::access;

    template<class Archive>
    void serialize(Archive & ar, const unsigned int version)
    {
        ar & m;//I think this is probably wrong, see error
    }

to class definition, right?

I get this runtime error : Unhandled exception at 0x758c9617 in client.exe: Microsoft C++ exception: boost::archive::archive_exception at memory location 0x02209110

on the client side when I try to deserialise from a archive to an object instance.

std::istringstream iss(recvd_msg);
boost::archive::text_iarchive ia(iss); 
            cMatrix3d rot;
            ia>>rot;
share|improve this question

1 Answer 1

Try

private:
    friend class boost::serialization::access;

    template<class Archive>
    void serialize(Archive & ar, const unsigned int version)
    {
        for (int i = 0; i != 3; ++i)
        {
            ar & m[i];
        }
    }
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.