
From: Steven Watanabe
Ben wrote:
template<class Ar> void save_construct_data(Ar & ar, const B * b, const unsigned int ver) { ar << (&(b->a)); }
<snip>
You're trying to serialize an rvalue.
thanks for pointing out my error. how do i get around it? i am not a C++ expert but how do i serialize the reference as a pointer? i tried various castings to no avail. by the way, what i wrote was copied nearly verbatim from the documentation template<class Archive> inline void save_construct_data( Archive & ar, const my_class * t, const unsigned int file_version ){ // save data required to construct instance ar << t.member1; // serialize reference to object as a pointer ar << & t.member2; } which seems like it wouldn't compile, since t is a pointer so t.member2 doesn't seem right. thanks, and best regards, ben