Ticket #2603: owner_before.patch
File owner_before.patch, 2.2 KB (added by , 14 years ago) |
---|
-
boost/shared_ptr.hpp
511 511 return pn; 512 512 } 513 513 514 template<class Y> bool _internal_less(shared_ptr<Y> const & rhs) const514 template<class Y> bool owner_before(shared_ptr<Y> const & rhs) const 515 515 { 516 516 return pn < rhs.pn; 517 517 } 518 518 519 template<class Y> bool owner_before(weak_ptr<Y> const & rhs) const 520 { 521 return pn < rhs.pn; 522 } 523 519 524 bool _internal_equiv( shared_ptr const & r ) const 520 525 { 521 526 return px == r.px && pn == r.pn; … … 562 567 563 568 template<class T, class U> inline bool operator<(shared_ptr<T> const & a, shared_ptr<U> const & b) 564 569 { 565 return a. _internal_less(b);570 return a.owner_before(b); 566 571 } 567 572 568 573 template<class T> inline void swap(shared_ptr<T> & a, shared_ptr<T> & b) -
boost/weak_ptr.hpp
141 141 pn = pn2; 142 142 } 143 143 144 template<class Y> bool _internal_less(weak_ptr<Y> const & rhs) const144 template<class Y> bool owner_before(shared_ptr<Y> const & rhs) const 145 145 { 146 146 return pn < rhs.pn; 147 147 } 148 148 149 template<class Y> bool owner_before(weak_ptr<Y> const & rhs) const 150 { 151 return pn < rhs.pn; 152 } 153 149 154 // Tasteless as this may seem, making all members public allows member templates 150 155 // to work in the absence of member template friends. (Matthew Langston) 151 156 … … 165 170 166 171 template<class T, class U> inline bool operator<(weak_ptr<T> const & a, weak_ptr<U> const & b) 167 172 { 168 return a. _internal_less(b);173 return a.owner_before(b); 169 174 } 170 175 171 176 template<class T> void swap(weak_ptr<T> & a, weak_ptr<T> & b) -
libs/smart_ptr/test/Jamfile.v2
50 50 [ run wp_convertible_test.cpp ] 51 51 [ run ip_convertible_test.cpp ] 52 52 [ run allocate_shared_test.cpp ] 53 [ run owner_less_test.cpp ] 53 54 ; 54 55 }