Boost logo

Boost-Commit :

From: dave_at_[hidden]
Date: 2008-03-30 12:18:04


Author: dave
Date: 2008-03-30 12:18:03 EDT (Sun, 30 Mar 2008)
New Revision: 43949
URL: http://svn.boost.org/trac/boost/changeset/43949

Log:
fixes #1711
Text files modified:
   trunk/boost/archive/detail/register_archive.hpp | 12 ++++++++++--
   trunk/boost/serialization/export.hpp | 2 +-
   2 files changed, 11 insertions(+), 3 deletions(-)

Modified: trunk/boost/archive/detail/register_archive.hpp
==============================================================================
--- trunk/boost/archive/detail/register_archive.hpp (original)
+++ trunk/boost/archive/detail/register_archive.hpp 2008-03-30 12:18:03 EDT (Sun, 30 Mar 2008)
@@ -6,6 +6,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 <class Archive, class Serializable>
 struct ptr_serialization_support;
 
@@ -24,7 +32,7 @@
 // in overload resolution with the functions declared by
 // BOOST_SERIALIZATION_REGISTER_ARCHIVE, below.
 template <class Serializable>
-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
@@ -36,7 +44,7 @@
                                                                         \
 template <class Serializable> \
 typename _ptr_serialization_support<Archive, Serializable>::type \
-instantiate_ptr_serialization( Serializable*, Archive* ); \
+instantiate_ptr_serialization( Serializable*, Archive*, adl_tag ); \
                                                                         \
 }}}
 

Modified: trunk/boost/serialization/export.hpp
==============================================================================
--- trunk/boost/serialization/export.hpp (original)
+++ trunk/boost/serialization/export.hpp 2008-03-30 12:18:03 EDT (Sun, 30 Mar 2008)
@@ -119,7 +119,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());
         return *this;
     }
     const guid_initializer & export_guid(char const* key, mpl::true_){


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk