Ticket #3840: get_ptr_fix.patch
File get_ptr_fix.patch, 18.8 KB (added by , 13 years ago) |
---|
-
boost/intrusive/avltree.hpp
167 167 168 168 static node_ptr uncast(const_node_ptr ptr) 169 169 { 170 return node_ptr(const_cast<node*>(detail::get_pointer (ptr)));170 return node_ptr(const_cast<node*>(detail::get_pointer_no_adl(ptr))); 171 171 } 172 172 173 173 size_traits &priv_size_traits() … … 1398 1398 static avltree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator) 1399 1399 { 1400 1400 header_plus_size *r = detail::parent_from_member<header_plus_size, node> 1401 ( detail::get_pointer (end_iterator.pointed_node()), &header_plus_size::header_);1401 ( detail::get_pointer_no_adl(end_iterator.pointed_node()), &header_plus_size::header_); 1402 1402 node_plus_pred_t *n = detail::parent_from_member 1403 1403 <node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_); 1404 1404 data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_); -
boost/intrusive/avltree_algorithms.hpp
104 104 105 105 static node_ptr uncast(const_node_ptr ptr) 106 106 { 107 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer (ptr)));107 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer_no_adl(ptr))); 108 108 } 109 109 /// @endcond 110 110 -
boost/intrusive/derivation_value_traits.hpp
44 44 { return node_ptr(&value); } 45 45 46 46 static pointer to_value_ptr(node_ptr n) 47 { return pointer(static_cast<T*>(detail::get_pointer (n))); }47 { return pointer(static_cast<T*>(detail::get_pointer_no_adl(n))); } 48 48 49 49 static const_pointer to_value_ptr(const_node_ptr n) 50 { return const_pointer(static_cast<const T*>(detail::get_pointer (n))); }50 { return const_pointer(static_cast<const T*>(detail::get_pointer_no_adl(n))); } 51 51 }; 52 52 53 53 } //namespace intrusive -
boost/intrusive/detail/hashtable_node.hpp
164 164 { return *this->operator ->(); } 165 165 166 166 pointer operator->() const 167 { return detail::get_pointer (this->get_real_value_traits()->to_value_ptr(downcast_bucket(slist_it_.pointed_node()))); }167 { return detail::get_pointer_no_adl(this->get_real_value_traits()->to_value_ptr(downcast_bucket(slist_it_.pointed_node()))); } 168 168 169 169 const Container *get_container() const 170 { return detail::get_pointer (cont_); }170 { return detail::get_pointer_no_adl(cont_); } 171 171 172 172 const real_value_traits *get_real_value_traits() const 173 173 { return &this->get_container()->get_real_value_traits(); } … … 175 175 private: 176 176 void increment() 177 177 { 178 const Container *cont = detail::get_pointer (cont_);179 bucket_type* buckets = detail::get_pointer (cont->bucket_pointer());178 const Container *cont = detail::get_pointer_no_adl(cont_); 179 bucket_type* buckets = detail::get_pointer_no_adl(cont->bucket_pointer()); 180 180 size_type buckets_len = cont->bucket_count(); 181 181 182 182 ++slist_it_; -
boost/intrusive/detail/list_node.hpp
143 143 { return *operator->(); } 144 144 145 145 pointer operator->() const 146 { return detail::get_pointer (this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }146 { return detail::get_pointer_no_adl(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); } 147 147 148 148 const Container *get_container() const 149 149 { -
boost/intrusive/detail/slist_node.hpp
122 122 { return *operator->(); } 123 123 124 124 pointer operator->() const 125 { return detail::get_pointer (this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }125 { return detail::get_pointer_no_adl(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); } 126 126 127 127 const Container *get_container() const 128 128 { -
boost/intrusive/detail/tree_algorithms.hpp
140 140 141 141 static node_ptr uncast(const_node_ptr ptr) 142 142 { 143 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer (ptr)));143 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer_no_adl(ptr))); 144 144 } 145 145 /// @endcond 146 146 -
boost/intrusive/detail/tree_node.hpp
153 153 { return *operator->(); } 154 154 155 155 pointer operator->() const 156 { return detail::get_pointer (this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); }156 { return detail::get_pointer_no_adl(this->get_real_value_traits()->to_value_ptr(members_.nodeptr_)); } 157 157 158 158 const Container *get_container() const 159 159 { return static_cast<const Container*>(members_.get_ptr()); } -
boost/intrusive/detail/utilities.hpp
125 125 //!Overload for smart pointers to avoid ADL problems with get_pointer 126 126 template<class Ptr> 127 127 inline typename smart_ptr_type<Ptr>::pointer 128 get_pointer (const Ptr &ptr)128 get_pointer_no_adl(const Ptr &ptr) 129 129 { return smart_ptr_type<Ptr>::get(ptr); } 130 130 131 131 //This functor compares a stored value … … 319 319 {} 320 320 321 321 const void *get_ptr() const 322 { return detail::get_pointer (const_void_ptr_); }322 { return detail::get_pointer_no_adl(const_void_ptr_); } 323 323 324 324 ConstVoidPtr const_void_ptr_; 325 325 }; … … 422 422 static pointer to_value_ptr(node_ptr n) 423 423 { 424 424 return detail::parent_from_member<T, Hook> 425 (static_cast<Hook*>(detail::get_pointer (n)), P);425 (static_cast<Hook*>(detail::get_pointer_no_adl(n)), P); 426 426 } 427 427 428 428 static const_pointer to_value_ptr(const_node_ptr n) 429 429 { 430 430 return detail::parent_from_member<T, Hook> 431 (static_cast<const Hook*>(detail::get_pointer (n)), P);431 (static_cast<const Hook*>(detail::get_pointer_no_adl(n)), P); 432 432 } 433 433 }; 434 434 -
boost/intrusive/hashtable.hpp
886 886 } 887 887 else{ 888 888 size_type buckets_len = this->priv_buckets_len(); 889 const bucket_type *b = detail::get_pointer (this->priv_buckets());889 const bucket_type *b = detail::get_pointer_no_adl(this->priv_buckets()); 890 890 for (size_type n = 0; n < buckets_len; ++n, ++b){ 891 891 if(!b->empty()){ 892 892 return false; … … 909 909 else{ 910 910 size_type len = 0; 911 911 size_type buckets_len = this->priv_buckets_len(); 912 const bucket_type *b = detail::get_pointer (this->priv_buckets());912 const bucket_type *b = detail::get_pointer_no_adl(this->priv_buckets()); 913 913 for (size_type n = 0; n < buckets_len; ++n, ++b){ 914 914 len += b->size(); 915 915 } … … 2240 2240 { return this->priv_real_bucket_traits().bucket_count(); } 2241 2241 2242 2242 static node_ptr uncast(const_node_ptr ptr) 2243 { return node_ptr(const_cast<node*>(detail::get_pointer (ptr))); }2243 { return node_ptr(const_cast<node*>(detail::get_pointer_no_adl(ptr))); } 2244 2244 2245 2245 node &priv_value_to_node(value_type &v) 2246 2246 { return *this->get_real_value_traits().to_node_ptr(v); } -
boost/intrusive/list.hpp
129 129 //Const cast emulation for smart pointers 130 130 static node_ptr uncast(const_node_ptr ptr) 131 131 { 132 //return node_ptr(detail::get_pointer (ptr)));133 return const_cast<node*>(detail::get_pointer (ptr));132 //return node_ptr(detail::get_pointer_no_adl(ptr))); 133 return const_cast<node*>(detail::get_pointer_no_adl(ptr)); 134 134 } 135 135 136 136 node_ptr get_root_node() … … 1268 1268 static list_impl &priv_container_from_end_iterator(const const_iterator &end_iterator) 1269 1269 { 1270 1270 root_plus_size *r = detail::parent_from_member<root_plus_size, node> 1271 ( detail::get_pointer (end_iterator.pointed_node()), &root_plus_size::root_);1271 ( detail::get_pointer_no_adl(end_iterator.pointed_node()), &root_plus_size::root_); 1272 1272 data_t *d = detail::parent_from_member<data_t, root_plus_size> 1273 1273 ( r, &data_t::root_plus_size_); 1274 1274 list_impl *s = detail::parent_from_member<list_impl, data_t>(d, &list_impl::data_); -
boost/intrusive/member_value_traits.hpp
49 49 static pointer to_value_ptr(node_ptr n) 50 50 { 51 51 return pointer(detail::parent_from_member<value_type, node> 52 (detail::get_pointer (n), PtrToMember));52 (detail::get_pointer_no_adl(n), PtrToMember)); 53 53 } 54 54 55 55 static const_pointer to_value_ptr(const_node_ptr n) 56 56 { 57 57 return pointer(detail::parent_from_member<value_type, node> 58 (detail::get_pointer (n), PtrToMember));58 (detail::get_pointer_no_adl(n), PtrToMember)); 59 59 } 60 60 }; 61 61 -
boost/intrusive/rbtree.hpp
167 167 168 168 static node_ptr uncast(const_node_ptr ptr) 169 169 { 170 return node_ptr(const_cast<node*>(detail::get_pointer (ptr)));170 return node_ptr(const_cast<node*>(detail::get_pointer_no_adl(ptr))); 171 171 } 172 172 173 173 size_traits &priv_size_traits() … … 1390 1390 static rbtree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator) 1391 1391 { 1392 1392 header_plus_size *r = detail::parent_from_member<header_plus_size, node> 1393 ( detail::get_pointer (end_iterator.pointed_node()), &header_plus_size::header_);1393 ( detail::get_pointer_no_adl(end_iterator.pointed_node()), &header_plus_size::header_); 1394 1394 node_plus_pred_t *n = detail::parent_from_member 1395 1395 <node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_); 1396 1396 data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_); -
boost/intrusive/rbtree_algorithms.hpp
157 157 158 158 static node_ptr uncast(const_node_ptr ptr) 159 159 { 160 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer (ptr)));160 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer_no_adl(ptr))); 161 161 } 162 162 /// @endcond 163 163 -
boost/intrusive/sgtree.hpp
310 310 { return data_.node_plus_pred_.header_plus_alpha_.header_; } 311 311 312 312 static node_ptr uncast(const_node_ptr ptr) 313 { return node_ptr(const_cast<node*>(detail::get_pointer (ptr))); }313 { return node_ptr(const_cast<node*>(detail::get_pointer_no_adl(ptr))); } 314 314 315 315 size_traits &priv_size_traits() 316 316 { return data_.node_plus_pred_.size_traits_; } … … 1631 1631 static sgtree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator) 1632 1632 { 1633 1633 header_plus_alpha *r = detail::parent_from_member<header_plus_alpha, node> 1634 ( detail::get_pointer (end_iterator.pointed_node()), &header_plus_alpha::header_);1634 ( detail::get_pointer_no_adl(end_iterator.pointed_node()), &header_plus_alpha::header_); 1635 1635 node_plus_pred_t *n = detail::parent_from_member 1636 1636 <node_plus_pred_t, header_plus_alpha>(r, &node_plus_pred_t::header_plus_alpha_); 1637 1637 data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_); -
boost/intrusive/sgtree_algorithms.hpp
70 70 71 71 static node_ptr uncast(const_node_ptr ptr) 72 72 { 73 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer (ptr)));73 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer_no_adl(ptr))); 74 74 } 75 75 /// @endcond 76 76 -
boost/intrusive/slist.hpp
206 206 { data_.root_plus_size_.last_ = n; } 207 207 208 208 static node_ptr uncast(const_node_ptr ptr) 209 { return node_ptr(const_cast<node*>(detail::get_pointer (ptr))); }209 { return node_ptr(const_cast<node*>(detail::get_pointer_no_adl(ptr))); } 210 210 211 211 void set_default_constructed_state() 212 212 { … … 1879 1879 //singly linked lists (because "end" is represented by the null pointer) 1880 1880 BOOST_STATIC_ASSERT(!linear); 1881 1881 root_plus_size *r = detail::parent_from_member<root_plus_size, node> 1882 ( detail::get_pointer (end_iterator.pointed_node()), (&root_plus_size::root_));1882 ( detail::get_pointer_no_adl(end_iterator.pointed_node()), (&root_plus_size::root_)); 1883 1883 data_t *d = detail::parent_from_member<data_t, root_plus_size> 1884 1884 ( r, &data_t::root_plus_size_); 1885 1885 slist_impl *s = detail::parent_from_member<slist_impl, data_t>(d, &slist_impl::data_); -
boost/intrusive/splaytree.hpp
166 166 167 167 static node_ptr uncast(const_node_ptr ptr) 168 168 { 169 return node_ptr(const_cast<node*>(detail::get_pointer (ptr)));169 return node_ptr(const_cast<node*>(detail::get_pointer_no_adl(ptr))); 170 170 } 171 171 172 172 size_traits &priv_size_traits() … … 1405 1405 static splaytree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator) 1406 1406 { 1407 1407 header_plus_size *r = detail::parent_from_member<header_plus_size, node> 1408 ( detail::get_pointer (end_iterator.pointed_node()), &header_plus_size::header_);1408 ( detail::get_pointer_no_adl(end_iterator.pointed_node()), &header_plus_size::header_); 1409 1409 node_plus_pred_t *n = detail::parent_from_member 1410 1410 <node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_); 1411 1411 data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_); -
boost/intrusive/splaytree_algorithms.hpp
147 147 private: 148 148 static node_ptr uncast(const_node_ptr ptr) 149 149 { 150 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer (ptr)));150 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer_no_adl(ptr))); 151 151 } 152 152 /// @endcond 153 153 -
boost/intrusive/treap.hpp
184 184 185 185 static node_ptr uncast(const_node_ptr ptr) 186 186 { 187 return node_ptr(const_cast<node*>(detail::get_pointer (ptr)));187 return node_ptr(const_cast<node*>(detail::get_pointer_no_adl(ptr))); 188 188 } 189 189 190 190 size_traits &priv_size_traits() … … 1482 1482 static treap_impl &priv_container_from_end_iterator(const const_iterator &end_iterator) 1483 1483 { 1484 1484 header_plus_size *r = detail::parent_from_member<header_plus_size, node> 1485 ( detail::get_pointer (end_iterator.pointed_node()), &header_plus_size::header_);1485 ( detail::get_pointer_no_adl(end_iterator.pointed_node()), &header_plus_size::header_); 1486 1486 typename node_plus_pred_t::header_plus_priority_size *n = 1487 1487 detail::parent_from_member 1488 1488 < typename node_plus_pred_t::header_plus_priority_size -
boost/intrusive/treap_algorithms.hpp
145 145 146 146 static node_ptr uncast(const_node_ptr ptr) 147 147 { 148 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer (ptr)));148 return node_ptr(const_cast<node*>(::boost::intrusive::detail::get_pointer_no_adl(ptr))); 149 149 } 150 150 /// @endcond 151 151 -
libs/intrusive/test/common_functors.hpp
29 29 { 30 30 typedef typename std::iterator_traits<Pointer>::value_type value_type; 31 31 BOOST_INTRUSIVE_INVARIANT_ASSERT(( detail::is_same<T, value_type>::value )); 32 delete detail::get_pointer (p);32 delete detail::get_pointer_no_adl(p); 33 33 } 34 34 }; 35 35 -
libs/intrusive/test/smart_ptr.hpp
303 303 pt2 = ptr; 304 304 } 305 305 306 //! detail::get_pointer() enables boost::mem_fn to recognize smart_ptr.306 //!get_pointer() enables boost::mem_fn to recognize smart_ptr. 307 307 //!Never throws. 308 308 template<class T> 309 309 inline T* get_pointer(const smart_ptr<T> & p)