Boost logo

Boost Users :

From: Chris Coleman (cqc_at_[hidden])
Date: 2005-07-19 10:46:41


I'm having trouble with serializing an object through a pointer to it.

The code below works in 1.32, but in 1.33 it gives the errors below. I
am using Mac OS X 10.4.2, gcc 4.0.

I've had a look at the headers, but my template programming isn't good
enough to make too much sense of them. It seems that there is a check
to ensure T is not a pointer on line 549 of oserializer.hpp, which is
the reason the static assert is failing?

Is it correct that objects shouldn't be serializable by pointers to
them, or not?


gps_position* p_g = new gps_position(35, 59, 24.567f);
oa << p_g; // causes the error's below

g++ -o test test.cpp -lboost_serialization-d-1_33
/usr/local/include/boost/archive/detail/oserializer.hpp: In function
'void boost::archive::save(Archive&, T&) [with Archive =
boost::archive::text_oarchive, T = gps_position*]':
instantiated from 'void
boost::archive::basic_text_oarchive<Archive>::save_override(T&, int)
[with T = gps_position*, Archive = boost::archive::text_oarchive]'
instantiated from 'Archive&
[with T = gps_position*, Archive = boost::archive::text_oarchive]'
hash_test.cpp:130: instantiated from here
/usr/local/include/boost/archive/detail/oserializer.hpp:560: error:
invalid application of 'sizeof' to incomplete type

This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at