
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>; -- Michael Marcin