Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] Strange giant warning
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-03-11 11:08:30


Avi Bahra wrote:
>> I'm speaking from memory and it's possible that the situation
>> has changed since 1.39 and the message is now spurious. If so
>> send a small test case which shows that the library has a bug.
>>
>> Robert Ramey
>
> The case you highlight is correct, and should produce a
> warning message. However a small variation shown below
> produces the same message, which I believe is wrong .
>
> This warning message is present in1.39, 1.40 on HPUX
> and AIX , on Linux/gcc there is _no_ such warning.
>
> class concrete {
> ...
> };
>
> class base {
> ~virtual base();
> ...
> vector<boost::shared_ptr<concrete> > vec_;
> };
>
> class derived : public base {
> ....
> };
>
> BOOST_CLASS_EXPORT(Derived);
>
> Here you will see the same warning message,
> saying that class 'concrete' should be polymorphic.
>

I just compiled the following without any warning message (in boost 1.43)

#include <vector>
#include <boost/serialization/export.hpp>
#include <boost/serialization/shared_ptr.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
class concrete {
};
class base {
std::vector<boost::shared_ptr<concrete> > vec_;
public:
virtual ~base();
};
class derived : public base {
};
template<class Archive>
void serialize(Archive &ar, derived & t, const unsigned int version);
BOOST_CLASS_EXPORT(derived);

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