Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2008-07-21 12:27:37


> I took
> http://lists.boost.org/boost-users/att-26574/test_serialize.cpp and
> modified it by changing
> #include <boost/serialization/is_abstract.hpp>
> to
> #include <boost/type_traits/is_abstract.hpp>

Try using boost/serialization/assume_abstract.hpp

Robert Ramey

Dan Thomas wrote:
>>> If I use gcc 3.2.3 (Linux) and Boost 1.35.0 to compile the example
>>> program at...
>>> http://lists.boost.org/boost-users/att-26574/test_serialize.cpp
>>> ...I get extensive compile errors which I can summarise as:
>>> <path>/boost_1_35_0/boost/serialization/export.hpp:125:
>>> `instantiate'
>>> is not a member of type
>>>
>>> `boost::archive::detail::ptr_serialization_support<boost::archive::text_iarchive,
>>> base>'
>>>
>>> These errors do not occur if I use either Boost 1.33.0 or Microsoft
>>> Visual Studio.
>>>
>>> The fact that the test program's base class is abstract seems to be
>>> central to the problem. The error
>>> is eliminated if I remove the BOOST_IS_ABSTRACT(base) statement
>>> from the test program. Doing
>>> so naturally causes other problems but these are in turn fixed by
>>> making "base" concrete i.e. by
>>> removing the =0 qualifier from base::get_id() and providing an
>>> implementation.
>>>
>>> It looks as if code in Boost 1.35.0 expects all classes to provide
>>> an instantiate method, even though
>>> the method is not in fact present on classes that have been marked
>>> as abstract. Is there any chance
>>> of a fix or work-around?
>
>> I"m not sure what the problem is here.
>>
>> In 1.36 (and the trunk) we've made some alterations and fixed things
>> in this area.
>
> I've just downloaded the head version of 1.36 and tried that but hit
> very similar problems. In more detail...
>
> I took
> http://lists.boost.org/boost-users/att-26574/test_serialize.cpp and
> modified it by changing
> #include <boost/serialization/is_abstract.hpp>
> to
> #include <boost/type_traits/is_abstract.hpp>
> And
> BOOST_IS_ABSTRACT(base);
> to
> BOOST_SERIALIZATION_ASSUME_ABSTRACT(base);
>
> The result compiles OK with MSVC 8.0 but generates two errors on gcc
> 3.2.3: <path>/boost_1_36_0/boost/serialization/export.hpp:98:
> `instantiate' is not a member of type
>
> `boost::archive::detail::ptr_serialization_support<boost::archive::text_oarchive,
> derived>' <path>/boost_1_36_0/boost/serialization/export.hpp:98:
> `instantiate' is not a member of type
>
> `boost::archive::detail::ptr_serialization_support<boost::archive::text_iarchive,
> derived>' In other words, the same error as before but affecting different
> classes.
> I should also say that although I am using a stock test program to
> demonstrate this problem, it also affects the real code that I am
> writing - the issue is not just academic.
>
> Thanks
>
> Dan


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