Boost logo

Boost Users :

Subject: Re: [Boost-users] [serialization][1.42.0] gcc(4.01)/xcode(3.1.2) failure to register type
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-05-04 17:47:59


Jeff Flinn wrote:

>> void
>> register_all_modules(){
>> const extended_type_info & eti =
>> extended_type_info_typeid<my_type>::get_const_instance const
>> extended_type_info & eti =
>> extended_type_info_typeid<my_type>::get_const_instance();
>
> I'll have to study what you've presented here.

LOL, I accidently hit the send key while creating my thought. Actually
having thought about this some, I think it might be possible, but I think
it will take more thought.

>
> Just as another data point, on MSVC I was able to link with /OPT:REF
> to optimize away unref'd functions and data by declaring my serialize
> methods as:
>
> template<class Archive>
> BOOST_DLLEXPORT void serialize(Archive&, const unsigned int)
> BOOST_USED;
>
> (the macros being defined in your force_include.hpp) and all links and
> runs perfectly, reducing my release exe size from 3.6MB to 2.6MB. I'm
> guessing you have a #pragma somewhere that is responsible for
> generating .exp and .lib files for my executable as I have no
> explicit MSVC settings to generate these.

This is on the right track. seems to me it should work for gcc as well.

It still wouldn't address serialization of objects through a base class
pointer.
Failure to do this would result in "not registered". For this, one will
need
similary magic for extended_type_info records.

Robert Ramey

>
> Jeff


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