Ticket #1711: weird.patch

File weird.patch, 2.0 KB (added by Sohail Somani, 15 years ago)

This patch shows which instantiation is causing the problem.

  • boost/serialization/export.hpp

     
    4949namespace archive {
    5050namespace detail {
    5151
     52#ifdef BEFORE
    5253class basic_pointer_iserializer;
    5354class basic_pointer_oserializer;
    5455
     
    115116template<class T>
    116117struct guid_initializer
    117118
    118     const guid_initializer & export_guid(char const* key, mpl::false_){
    119         // generates the statically-initialized objects whose constructors
    120         // register the information allowing serialization of T objects
    121         // through pointers to their base classes.
    122         instantiate_ptr_serialization((T*)0, 0);
    123         return *this;
    124     }
     119  const guid_initializer & export_guid(char const* key, mpl::false_);
     120
    125121    const guid_initializer & export_guid(char const* key, mpl::true_){
    126122        return *this;
    127123    }
     
    140136    }
    141137};
    142138
     139#else
     140
     141// WORKS IF THIS DEFINITION IS AFTER INCLUDING THE ARCHIVE HEADERS
     142// HUH?
     143template<typename T>
     144const guid_initializer<T> &
     145guid_initializer<T>::export_guid(char const * key, mpl::false_)
     146{
     147  instantiate_ptr_serialization((T*)0,0);
     148  return *this;
     149}
     150
     151#endif
     152
    143153} // namespace detail
    144154} // namespace archive
    145155} // namespace boost
  • libs/serialization/test/test_exported.cpp

     
    1818}
    1919#endif
    2020
     21#define BEFORE
     22#include <boost/serialization/export.hpp>
     23#undef BEFORE
     24
     25#include "text_archive.hpp"
     26
     27#undef BOOST_SERIALIZATION_EXPORT_HPP
     28#include <boost/serialization/export.hpp>
     29
     30
    2131#include <boost/serialization/base_object.hpp>
    2232#include <boost/serialization/type_info_implementation.hpp>
    2333#include <boost/archive/archive_exception.hpp>
    2434#include "test_tools.hpp"
    25 #include <boost/serialization/export.hpp>
    2635
    2736#include "base.hpp"
    2837