|
Boost Users : |
Subject: Re: [Boost-users] [serialization] Export question
From: Robert Ramey (ramey_at_[hidden])
Date: 2009-04-08 14:51:33
BOOST_CLASS_VERSION should be in the header. This might be overkill, but
its a natural place for it, it's bonehead proof and doesn't have any side
effects. BOOST_CLASS_EXPORT has the side effect of instantiatine code so
it's "special"
My original intention was that all these "serialization traits" be part of
the class header description. BOOST_CLASS_EXPORT sort of broke this idea
but it still holds for the other ones.
Robert Ramey
troy d. straszheim wrote:
> Robert Ramey wrote:
>>
>> a) Don't put EXPORT macro in headers.
>> b) Add a small module to your main code which looks like
>>
>> #include archive
>> .... // repeat as necessary
>>
>> #include "a.hpp"
>> BOOST_CLASS_EXPORT(A)
>> .... // repeat as necessary for each class defined in the main line
>>
>> c) for each DLL - do the same thing for classes defined in the DLL.
>>
>> Robert Ramey
>>
>
> Hey,
>
> I'm wondering if this applies for BOOST_CLASS_VERSION as well. Seems
> like it should, as you want to be able to #include "myclass.hpp"
> without worrying about serialization dependencies. I seem to
> remember seeing some cases where the version wasn't picked up by the
> archive if the BOOST_CLASS_VERSION wasn't in the header. Ring any
> bells? If not I can go back and check.
>
> -t
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