Boost logo

Boost Users :

Subject: [Boost-users] [serialization] Different behaviors between archive and its polymorphic variant
From: Maxime van Noppen (maxime_at_[hidden])
Date: 2010-08-07 09:54:50


I'm trying to make a custom archive class that works either with the
template flavor or via the polymorphic_archive. It compiles but produces
a different behavior and I can't find why.

Basically I did a trivial oarchive class that overloads (via
save_override) how are treated NVP. When used with the template version
it works, whereas with the polymorphic version it doesn't.

The code is attached. There is a preprocessor switch to choose the
template or polymorphic version (-DPOLY).

$ g++ -lboost_serialization && ./a.out
$ g++ -DPOLY -lboost_serialization && ./a.out

This is with Boost 1.43 and g++ 4.5.0.

I looked at various archive implementations but couldn't find any code
that I could relate to this problem.



Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at