|
Boost Users : |
Subject: Re: [Boost-users] [Boost.Serialization] Serializing "abstract"classes
From: Robert Ramey (ramey_at_[hidden])
Date: 2011-08-05 16:37:14
Júlio Hoffimann wrote:
> Just correcting another mistake mine, the warning is not on line 40
> as i said. It's in export.hpp 134:40.
>
That's where it's detected. It's caused somehere else - see below.
>
> Do you have any hint Robert? What could i do to fix this? I heard
> Boost.Serialization changed dramatically from 1.45 to actual
> versions. I just don't want to upgrade right now because i'm the
> middle of another job.
>
One obvious problem is that the base class is not abstract. To be abstract,
a base class must have atleast one virtual function in the form
virtual my_function() = 0;
The ASSUME_ABSTRACT macro doesn't mark it abstract to the
compiler - it marks it abstract to the boost type-traites system.
I know it's quirky and unclear - but I see no way to make it bullet proof.
I'm sort of surprised/disappointed that this doesn't give a compile time
warning. What compiler do you use?
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