Boost logo

Boost Users :

From: codeur_at_[hidden]
Date: 2005-12-21 09:20:29


Hello,

Four questions about serialization :=) Let's go.

1)

I have a class that have a reference on a vector of shared pointers to
objects . Since I have no default constructors I redefined
save_construct_data like this :

template<class Archive>
inline void save_construct_data(
  Archive & ar,
  const MyClass<Real> * t, // CLASS IS TEMPLATED
  const unsigned int file_version)
{
  ar << & t->myref_;
}

I have got the following error (same problem with & operator):
error: no match for 'operator<<' in 'ar << [...]

2) I there a tricky way to define this function for all type used to
instantiate MyClass ?

3) Is it me or this example in the documentation :

     // save data required to construct instance
    ar << t.member1;
    // serialize reference to object as a pointer
    ar << & t.member2;

should be :

ar << t->member1;
ar << & t->member2;

?

4) Should it be possible to add more examples which use templates in the
library (since a lot of a macros are not available) ?

Thanks in advance for your help!


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net