Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] Restoring from text archive compile error
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-06-27 12:27:58


Dante Stroe wrote:
> Yep that's what It was, thanks for the help, I guess I should have
> looked further into the error messages. Since however I didn't want to
> modify the implementation of the class, I used the const_cast on the
> constant members which worked just fine. I do have a couple of more
> general questions:
> 1) What is the benefit/reason for using
> BOOST_SERIALIZATION_ASSUME_ABSTRACT as it is used in the tutorial
> demo.cpp for an abstract class (it obviously works without it)?

the "is_abstract" type trait doesn't work on all platforms.
BOOST_SERIALIZATION_ASSUME_ABSTRACT is a no-op on those
platforms where "is_abstract does work and a specialization on those
platforms where it does ... or something like that. It permits your
code (and test code) to be run on all compilers.

> 2) In the case where the base class has no serializable members
> (like it is the case for the my "base" class), I get a warning for
> unused parameter ar as expected, however is there any defacto way to
> bypass that ?

You can get around that by explicitly defining a void_cast specialization.
I think one of the test does that to avoid bogus warning.
But it doesn't really add anything except shutting down the warning.

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