Boost logo

Boost :

Subject: Re: [boost] [Serialization] this seems wrong
From: Kenny Riddile (kfriddile_at_[hidden])
Date: 2008-12-02 14:43:15


Michael Marcin wrote:
> Michael Marcin wrote:
>> Michael Marcin wrote:
>>> I don't know about getting rid of the unnamed namespace but
>>> essentially we just need a unique name per type in a translation
>>> unit.. so how about:
>>>
>>> #define BOOST_CLASS_EXPORT_GUID(T, K) \
>>> namespace \
>>> { \
>>> template< typename U > \
>>> class init_guid \
>>> { \
>>> static ::boost::archive::detail::guid_initializer<U> const & \
>>> guid_initializer_; \
>>> }; \
>>> template<> ::boost::archive::detail::guid_initializer<T> const & \
>>> init_guid<T>::guid_initializer_ = \
>>> ::boost::serialization::singleton< \
>>> ::boost::archive::detail::guid_initializer<T> \
>>> >::get_mutable_instance().export_guid(K); \
>>> }
>>>
>>
>> Do we still need to explicitly instantiate init_guid here? If so add
>>
>> template class init_guid<T>;
>>
>
> Never mind this fails if we have 2 export macros.. silly me.
>
I'm thinking I may just call BOOST_CLASS_EXPORT_GUID directly instead of
BOOST_CLASS_EXPORT to get around this problem.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk