Ticket #3957: patchfile-2.patch

File patchfile-2.patch, 2.7 KB (added by Carus V. (Bud) Clarke <carus.v.clarke@…>, 13 years ago)

Corrected patch file

  • libs/serialization/src/shared_ptr_helper.cpp

    old new  
    6666    collection_type::iterator i = m_pointers->find(sp);
    6767
    6868    if(i == m_pointers->end()){
    69         std::pair<collection_type::iterator, bool> result;
    70         shared_ptr<const void> sp(const_cast<void * >(od), void_deleter(true_type));
    71         result = m_pointers->insert(sp);
    72         assert(result.second);
    73         i = result.first;
     69        // temp: std::pair<collection_type::iterator, bool> result;
     70        // temp: shared_ptr<const void> sp(const_cast<void * >(od), void_deleter(true_type));
     71        // temp: result = m_pointers->insert(sp);
     72        // temp: assert(result.second);
     73        // temp: i = result.first;
     74        shared_ptr<void> np;
     75        return np;
    7476    }
    7577    od = void_upcast(
    7678        *true_type,
     
    9294    );
    9395}
    9496
     97BOOST_ARCHIVE_DECL(void)
     98shared_ptr_helper::append(const boost::shared_ptr<const void> &sp){
     99
     100    // make tracking array if necessary
     101    if(NULL == m_pointers)
     102        m_pointers = new collection_type;
     103
     104    collection_type::iterator i = m_pointers->find(sp);
     105
     106    if(i == m_pointers->end()){
     107        std::pair<collection_type::iterator, bool> result;
     108        result = m_pointers->insert(sp);
     109        assert(result.second);
     110    }
     111}
     112
    95113//  #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP
    96114BOOST_ARCHIVE_DECL(void)
    97115shared_ptr_helper::append(const boost_132::shared_ptr<const void> & t){
  • boost/archive/shared_ptr_helper.hpp

    old new  
    121121        const boost::serialization::extended_type_info * this_type
    122122    );
    123123
     124    BOOST_ARCHIVE_DECL(void)
     125    append(const boost::shared_ptr<const void> &);
     126
    124127    template<class T>
    125128    struct non_polymorphic {
    126129        static const boost::serialization::extended_type_info *
     
    179182                this_type
    180183            );
    181184
    182         s = shared_ptr<T>(
    183             r,
    184             static_cast<T *>(r.get())
    185         );
     185        if (!r)
     186        {
     187           s.reset(t);
     188           const void * od = void_downcast(
     189               *true_type,
     190               *this_type,
     191               static_cast<const void *>(t)
     192           );
     193           shared_ptr<const void> sp(s, od);
     194           append(sp);
     195        }
     196        else
     197        {
     198            s = shared_ptr<T>(
     199                r,
     200                static_cast<T *>(r.get())
     201            );
     202        }
    186203
    187204        //s = static_pointer_cast<T,void>(
    188205        //    const_pointer_cast<void, const void>(*r)