Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] assertion failure on exit
From: Kenny Riddile (kfriddile_at_[hidden])
Date: 2008-12-08 15:35:27


> Do you have the same problem if your destructor is not pure virtual?

Yes, it still asserts if the base class destructor is virtual rather
than pure-virtual.

> As a side note, why is this destructor pure virtual, rather than just be
> virtual? Are you trying to make your class not be instantiable directly, but
> only be instantiable from a derived class? In that case, simply make your
> constructors protected.

Yes, it is pure-virtual to prevent direct instantiation. Adding a
constructor definition and making it protected just seems like a more
obfuscated, verbose way of achieving the same result. It isn't even the
same result either. With the protected constructor method, someone
could still add a friend later on which could instantiate a Serializable
object directly.


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