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

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

(and there are some weird glyphs showing up at the top of the menu at 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 Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at