Ticket #2291: changeset_r43949_backport.patch

File changeset_r43949_backport.patch, 2.2 KB (added by Dave Abrahams, 14 years ago)
  • boost/serialization/export.hpp

     
    9898    // generates the statically-initialized objects whose constructors
    9999    // register the information allowing serialization of T objects
    100100    // through pointers to their base classes.
    101     instantiate_ptr_serialization((T*)0, 0);
     101    instantiate_ptr_serialization((T*)0, 0, adl_tag());
    102102}
    103103
    104104// On many platforms, naming a specialization of this template is
  • boost/archive/detail/register_archive.hpp

     
    88
    99namespace boost { namespace archive { namespace detail {
    1010
     11// This is for the sake of GCC 4.1 et. al, which doesn't seem to see
     12// the instantiate_ptr_serialization overloads generated by
     13// BOOST_SERIALIZATION_REGISTER_ARCHIVE if they lexically follow the
     14// call *unless* they are in an associated namespace of one of the
     15// arguments.  I am not 100% sure of what the standard says on this
     16// point, and am investigating. - Dave A.
     17struct adl_tag {};
     18
    1119template <class Archive, class Serializable>
    1220struct ptr_serialization_support;
    1321
     
    2634// in overload resolution with the functions declared by
    2735// BOOST_SERIALIZATION_REGISTER_ARCHIVE, below.
    2836template <class Serializable>
    29 void instantiate_ptr_serialization(Serializable*, int) {}
     37void instantiate_ptr_serialization(Serializable*, int, adl_tag) {}
    3038
    3139// The function declaration generated by this macro never actually
    3240// gets called, but its return type gets instantiated, and that's
     
    3846                                                                        \
    3947template <class Serializable>                                           \
    4048typename _ptr_serialization_support<Archive, Serializable>::type        \
    41 instantiate_ptr_serialization( Serializable*, Archive* );               \
     49instantiate_ptr_serialization( Serializable*, Archive*, adl_tag );      \
    4250                                                                        \
    4351}}}
    4452