Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-11-29 23:57:49


look in the docs under

Reference/ ClassSerialization/ Class Serializaton/Traits/Abstract

for an abstract class T

ar << T, ar >> T, ar & T will fail at compilation - as they must

ar << * T, ar >> * T, ar & * T will function correctly but T should
correspond to an instance of a derived type.

use BOOST_IS_ABSTRACT to indicate that a class is abstract and should only
be serialized through its most derived type.

Robert Ramey

Robert Ramey
"Jeffrey Holle" <jeff.holle_at_[hidden]> wrote in message
news:cogfj2$sm2$1_at_sea.gmane.org...
> I'm running into trouble handling an abstract object in my attempt to
> apply boost.serialization to my application.
>
> Since it doesn't have state, initially I didn't add serialize methods to
> this class, and got compilization errors for want of these methods.
>
> Next, I added noop methods, and got errors because the serialization
> package attempted to construct an abstract class.
>
> I see there is an is_abstract template, but don't know how to employ it.
>
> Can somebody give me some pointers?
>
> Note that I've choosen to implement non-templated serialize methods,
> using a forwared reference of the desired archive classes.
>
> Should this template be in the definition file, or implementation file
> (inside or outside the serialize method(s))?


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