Ticket #11164: fix_stored_edge_property.patch

File fix_stored_edge_property.patch, 1.5 KB (added by dstoeckel@…, 8 years ago)

Always declare a copy constructor and copy assignment operator.

  • (a) adjacency_list.hpp.old vs. (b) /usr/include/boost/graph/detail/adjacency_list.hpp

    a b namespace boost {  
    296296      inline stored_edge_property(Vertex target,
    297297                                  const Property& p = Property())
    298298        : stored_edge<Vertex>(target), m_property(new Property(p)) { }
    299 #if defined(BOOST_MSVC) || (defined(BOOST_GCC) && (BOOST_GCC / 100) < 410)
    300       stored_edge_property(self&& x) : Base(static_cast< Base const& >(x)) {
    301         m_property.swap(x.m_property);
    302       }
    303299      stored_edge_property(self const& x) : Base(static_cast< Base const& >(x)) {
    304300        m_property.swap(const_cast<self&>(x).m_property);
    305301      }
    306       self& operator=(self&& x) {
     302      self& operator=(self const& x) {
    307303        Base::operator=(static_cast< Base const& >(x));
    308         m_property = std::move(x.m_property);
     304        m_property = std::move(const_cast<self&>(x).m_property);
    309305        return *this;
    310306      }
    311       self& operator=(self const& x) {
     307#if defined(BOOST_MSVC) || (defined(BOOST_GCC) && (BOOST_GCC / 100) < 410)
     308      stored_edge_property(self&& x) : Base(static_cast< Base const& >(x)) {
     309        m_property.swap(x.m_property);
     310      }
     311      self& operator=(self&& x) {
    312312        Base::operator=(static_cast< Base const& >(x));
    313         m_property = std::move(const_cast<self&>(x).m_property);
     313        m_property = std::move(x.m_property);
    314314        return *this;
    315315      }
    316316#else