Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] Strange warning + serialization of template derived class
From: dada_at_[hidden]
Date: 2010-02-14 05:36:09


Thanks for your reply, all is ok now.
But i need some explanation about understanding static_warning.

The warnings are :
------------------------------
../boost/mpl/print.hpp: In instantiation of
?boost::mpl::print<boost::serialization::STATIC_WARNING_LINE<98> >?:

../boost/serialization/static_warning.hpp:92: instantiated from
?boost::serialization::static_warning_test<false, 98>?

../boost/archive/detail/check.hpp:98: instantiated from ?void
boost::archive::detail::check_object_tracking() [with ...

../boost/archive/detail/oserializer.hpp:295: instantiated from
?static void
boost::archive::detail::save_non_pointer_type<Archive>::invoke(Archive&, T&)
[with T =...

../boost/archive/detail/oserializer.hpp:507: instantiated from ?void
boost::archive::save(Archive&, T&) [with Archive =
boost::archive::text_oarchive, T = ...

../boost/archive/detail/common_oarchive.hpp:62: instantiated from
?void
boost::archive::detail::common_oarchive<Archive>::save_override(T&,
int) [with T = ..

../boost/archive/basic_text_oarchive.hpp:75: instantiated from ?void
boost::archive::basic_text_oarchive<Archive>::save_override(T&, int)
[with T = ...

../boost/archive/detail/interface_oarchive.hpp:64: instantiated from
?Archive&
boost::archive::detail::interface_oarchive<Archive>::operator<<(T&)
[with T = ...

../testEXE/test.cpp:118: instantiated from here

../boost/mpl/print.hpp:55: warning: comparison between signed and
unsigned integer expressions
------------------------------

In fact, i think that this warnings are the consequences of non const
object serialization. But i'm not sure...

Best regards,
Damien.

Robert Ramey <ramey_at_[hidden]> a écrit :

> dada_at_[hidden] wrote:
>> Hi all,
>>
>> First problem:
>> --------------
>> i have this warning.
>> "...... boost/mpl/print.hpp:55: warning: comparison between signed and
>> unsigned integer expressions"
>
> the serialization library used this to indicate usage of the library which
> is permited though probably not a good idea. Check the compile
> error listing to find what calls this. This should show some place
> where BOOST_SERIALIZATION_STATIC_WARNING is
> invoked. There you should find an explanation of why such a
> warning was emitted.
>
>>
>> Second problem:
>> ---------------
>> I want to serialize a template derivate class like this:
>>
>>
>> ////////////////////////////
>> class Base
>> {
>> private:
>> friend class boost::serialization::access;
>>
>> template<class Archive>
>> void serialize(Archive &, const unsigned int )
>> {
>> }
>> };
>>
>> template<typenmame T>
>> class Child: public Base
>> {
>> private:
>> friend class boost::serialization::access;
>>
>> template<class Archive>
>> void serialize(Archive &ar, const unsigned int )
>> {
>> ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
>> }
>> };
>>
>> BOOST_CLASS_EXPORT_GUID(Child<int>, "Child")//don't work
>> ///////////////////////////
>>
>> The macro "BOOST_CLASS_EXPORT_GUID" don't work with template class.
>> Is there a way to do this ?
>
> I would guess that the <> characters are some sort of problem. Try
> typedef Child<int> Child_int
>
> BOOST_CLASS_EXPORT_GUID(Child_int, "ChildInt) // remember the name has to be
> unique!!
>
> Also there is a track item with a suggestion on how to implement the
> equivalent of:
>
> BOOST_CLASS_EXPORT(Child<int>)
>
> Robert Ramey
>
>
>
>
>> Thank you,
>> Regards,
>> Damien.
>
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>


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