Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-09-09 11:04:06


signature
Well, restoring objects using some sort of factory would give us a proper mechanism to restore objects with non default constructors or const members that haven't been serialized through pointers. That would be one way to overcome the assignment like limitation of restoring through operator>>. I believe the idea of a factory also holds well to restore objects serialized through pointers where the objects have to actually be reconstructed.

  what I really mean is what is the matter with
      class A {
          const X m_x
          ...
          template<class Archive>
          void serialize(Archive & ar, const unsigned int version){
              ar >> const_cast<X>(m_x);
          }
      };
  Doesn't this give the same result in a simpler more transparent way?

  Robert Ramey



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