Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-03-09 17:27:22


In giving a presentation about the serialization library on Tuesday
the students got very hung up on the const-correctness of output
streaming using the usual single serialize(MyClass&, ... ) function.
Can you serialize const objects that way? Does the library cast away
const?

One could get the compiler to deduce constness appropriately if the
object being serialized were specified as:

  template<class Archive, class GPSPosition>
  void serialize(Archive & ar, GPSPosition& g, const unsigned int version)

but of course that doesn't overload very well; you'd need some other
way to indicatethe type of the object to be serialized.
      
How is this all related to
http://www.boost.org/libs/serialization/doc/index.html?

(and there are some weird glyphs showing up at the top of the menu at
http://www.boost.org/libs/serialization/doc/index.html for me:

  ï»¿

that's a lowercase 'i' with diaresis, a spanish right double quote
character (looks like >>) and an inverted question mark.)

Thanks in advance,
Dave

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk