Boost logo

Boost Users :

Subject: [Boost-users] [Serialization] assert in void_caster
From: Alex Parkhomenko (alexander_at_[hidden])
Date: 2010-06-28 14:54:26


Hello,

I have the static library with two classes, "base" and "derived".

class base
{
public:
    base():a(0){};
    virtual ~base(){};

private:
    friend class boost::serialization::access;
    template<class Archive>
    void serialize(Archive & ar, const unsigned int version)
    {
       ar & a;
    }

private:
    int a;
};

class derived: public base
{
public:
    derived():b(0){};
    virtual ~derived(){};

private:
    friend class boost::serialization::access;
    template<class Archive>
    void serialize(Archive & ar, const unsigned int version)
    {
       ar & boost::serialization::base_object<base>(*this);
       ar & b;
    }

private:
    int b;
};

This static library is linked to two dynamic libraries. For example,
dll_a.dll and dll_b.dll. When I try to load those dlls in my application
(via LoadLibrary), I get assert in void_cast.cpp (225):

     std::pair<void_cast_detail::set_type::const_iterator, bool> result;
     result = s.insert(this);
     assert(result.second);

Is it by design? Or I missed something?

I am using boost v1.43 and VS 10 on Windows 7.

Thank you in advance.

Alex


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