Index: boost/serialization/export.hpp =================================================================== --- boost/serialization/export.hpp (revision 3118) +++ boost/serialization/export.hpp (working copy) @@ -98,7 +98,7 @@ // generates the statically-initialized objects whose constructors // register the information allowing serialization of T objects // through pointers to their base classes. - instantiate_ptr_serialization((T*)0, 0); + instantiate_ptr_serialization((T*)0, 0, adl_tag()); } // On many platforms, naming a specialization of this template is Index: boost/archive/detail/register_archive.hpp =================================================================== --- boost/archive/detail/register_archive.hpp (revision 3118) +++ boost/archive/detail/register_archive.hpp (working copy) @@ -8,6 +8,14 @@ namespace boost { namespace archive { namespace detail { +// This is for the sake of GCC 4.1 et. al, which doesn't seem to see +// the instantiate_ptr_serialization overloads generated by +// BOOST_SERIALIZATION_REGISTER_ARCHIVE if they lexically follow the +// call *unless* they are in an associated namespace of one of the +// arguments. I am not 100% sure of what the standard says on this +// point, and am investigating. - Dave A. +struct adl_tag {}; + template struct ptr_serialization_support; @@ -26,7 +34,7 @@ // in overload resolution with the functions declared by // BOOST_SERIALIZATION_REGISTER_ARCHIVE, below. template -void instantiate_ptr_serialization(Serializable*, int) {} +void instantiate_ptr_serialization(Serializable*, int, adl_tag) {} // The function declaration generated by this macro never actually // gets called, but its return type gets instantiated, and that's @@ -38,7 +46,7 @@ \ template \ typename _ptr_serialization_support::type \ -instantiate_ptr_serialization( Serializable*, Archive* ); \ +instantiate_ptr_serialization( Serializable*, Archive*, adl_tag ); \ \ }}}