Ticket #3840: get_ptr_fix.patch

File get_ptr_fix.patch, 18.8 KB (added by Andrey Semashev, 13 years ago)

The patch renames get_pointer function from Boost.Intrusive

  • boost/intrusive/avltree.hpp

     
    167167
    168168   static node_ptr uncast(const_node_ptr ptr)
    169169   {
    170       return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
     170      return node_ptr(const_cast<node*>(detail::get_pointer_no_adl(ptr)));
    171171   }
    172172
    173173   size_traits &priv_size_traits()
     
    13981398   static avltree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
    13991399   {
    14001400      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_);
    14021402      node_plus_pred_t *n = detail::parent_from_member
    14031403         <node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_);
    14041404      data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
  • boost/intrusive/avltree_algorithms.hpp

     
    104104
    105105   static node_ptr uncast(const_node_ptr ptr)
    106106   {
    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)));
    108108   }
    109109   /// @endcond
    110110
  • boost/intrusive/derivation_value_traits.hpp

     
    4444   { return node_ptr(&value); }
    4545
    4646   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))); }
    4848
    4949   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))); }
    5151};
    5252
    5353} //namespace intrusive
  • boost/intrusive/detail/hashtable_node.hpp

     
    164164   { return *this->operator ->(); }
    165165
    166166   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()))); }
    168168
    169169   const Container *get_container() const
    170    {  return detail::get_pointer(cont_);  }
     170   {  return detail::get_pointer_no_adl(cont_);  }
    171171
    172172   const real_value_traits *get_real_value_traits() const
    173173   {  return &this->get_container()->get_real_value_traits();  }
     
    175175   private:
    176176   void increment()
    177177   {
    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());
    180180      size_type   buckets_len    = cont->bucket_count();
    181181
    182182      ++slist_it_;
  • boost/intrusive/detail/list_node.hpp

     
    143143   {  return *operator->();   }
    144144
    145145   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_)); }
    147147
    148148   const Container *get_container() const
    149149   {
  • boost/intrusive/detail/slist_node.hpp

     
    122122   {  return *operator->();   }
    123123
    124124   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_)); }
    126126
    127127   const Container *get_container() const
    128128   {
  • boost/intrusive/detail/tree_algorithms.hpp

     
    140140
    141141   static node_ptr uncast(const_node_ptr ptr)
    142142   {
    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)));
    144144   }
    145145   /// @endcond
    146146
  • boost/intrusive/detail/tree_node.hpp

     
    153153   {  return *operator->();   }
    154154
    155155   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_)); }
    157157
    158158   const Container *get_container() const
    159159   {  return static_cast<const Container*>(members_.get_ptr());   }
  • boost/intrusive/detail/utilities.hpp

     
    125125//!Overload for smart pointers to avoid ADL problems with get_pointer
    126126template<class Ptr>
    127127inline typename smart_ptr_type<Ptr>::pointer
    128 get_pointer(const Ptr &ptr)
     128get_pointer_no_adl(const Ptr &ptr)
    129129{  return smart_ptr_type<Ptr>::get(ptr);   }
    130130
    131131//This functor compares a stored value
     
    319319   {}
    320320
    321321   const void *get_ptr() const
    322    {  return detail::get_pointer(const_void_ptr_);  }
     322   {  return detail::get_pointer_no_adl(const_void_ptr_);  }
    323323
    324324   ConstVoidPtr const_void_ptr_;
    325325};
     
    422422   static pointer to_value_ptr(node_ptr n)
    423423   {
    424424      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);
    426426   }
    427427
    428428   static const_pointer to_value_ptr(const_node_ptr n)
    429429   {
    430430      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);
    432432   }
    433433};
    434434
  • boost/intrusive/hashtable.hpp

     
    886886      }
    887887      else{
    888888         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());
    890890         for (size_type n = 0; n < buckets_len; ++n, ++b){
    891891            if(!b->empty()){
    892892               return false;
     
    909909      else{
    910910         size_type len = 0;
    911911         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());
    913913         for (size_type n = 0; n < buckets_len; ++n, ++b){
    914914            len += b->size();
    915915         }
     
    22402240   {  return this->priv_real_bucket_traits().bucket_count();  }
    22412241
    22422242   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)));  }
    22442244
    22452245   node &priv_value_to_node(value_type &v)
    22462246   {  return *this->get_real_value_traits().to_node_ptr(v);  }
  • boost/intrusive/list.hpp

     
    129129   //Const cast emulation for smart pointers
    130130   static node_ptr uncast(const_node_ptr ptr)
    131131   {
    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));
    134134   }
    135135
    136136   node_ptr get_root_node()
     
    12681268   static list_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
    12691269   {
    12701270      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_);
    12721272      data_t *d = detail::parent_from_member<data_t, root_plus_size>
    12731273         ( r, &data_t::root_plus_size_);
    12741274      list_impl *s  = detail::parent_from_member<list_impl, data_t>(d, &list_impl::data_);
  • boost/intrusive/member_value_traits.hpp

     
    4949   static pointer to_value_ptr(node_ptr n)
    5050   {
    5151      return pointer(detail::parent_from_member<value_type, node>
    52          (detail::get_pointer(n), PtrToMember));
     52         (detail::get_pointer_no_adl(n), PtrToMember));
    5353   }
    5454
    5555   static const_pointer to_value_ptr(const_node_ptr n)
    5656   {
    5757      return pointer(detail::parent_from_member<value_type, node>
    58          (detail::get_pointer(n), PtrToMember));
     58         (detail::get_pointer_no_adl(n), PtrToMember));
    5959   }
    6060};
    6161
  • boost/intrusive/rbtree.hpp

     
    167167
    168168   static node_ptr uncast(const_node_ptr ptr)
    169169   {
    170       return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
     170      return node_ptr(const_cast<node*>(detail::get_pointer_no_adl(ptr)));
    171171   }
    172172
    173173   size_traits &priv_size_traits()
     
    13901390   static rbtree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
    13911391   {
    13921392      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_);
    13941394      node_plus_pred_t *n = detail::parent_from_member
    13951395         <node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_);
    13961396      data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
  • boost/intrusive/rbtree_algorithms.hpp

     
    157157
    158158   static node_ptr uncast(const_node_ptr ptr)
    159159   {
    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)));
    161161   }
    162162   /// @endcond
    163163
  • boost/intrusive/sgtree.hpp

     
    310310   {  return data_.node_plus_pred_.header_plus_alpha_.header_;  }
    311311
    312312   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)));  }
    314314
    315315   size_traits &priv_size_traits()
    316316   {  return data_.node_plus_pred_.size_traits_;  }
     
    16311631   static sgtree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
    16321632   {
    16331633      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_);
    16351635      node_plus_pred_t *n = detail::parent_from_member
    16361636         <node_plus_pred_t, header_plus_alpha>(r, &node_plus_pred_t::header_plus_alpha_);
    16371637      data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
  • boost/intrusive/sgtree_algorithms.hpp

     
    7070
    7171   static node_ptr uncast(const_node_ptr ptr)
    7272   {
    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)));
    7474   }
    7575   /// @endcond
    7676
  • boost/intrusive/slist.hpp

     
    206206   {  data_.root_plus_size_.last_ = n;  }
    207207
    208208   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)));  }
    210210
    211211   void set_default_constructed_state()
    212212   {
     
    18791879      //singly linked lists (because "end" is represented by the null pointer)
    18801880      BOOST_STATIC_ASSERT(!linear);
    18811881      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_));
    18831883      data_t *d = detail::parent_from_member<data_t, root_plus_size>
    18841884         ( r, &data_t::root_plus_size_);
    18851885      slist_impl *s  = detail::parent_from_member<slist_impl, data_t>(d, &slist_impl::data_);
  • boost/intrusive/splaytree.hpp

     
    166166
    167167   static node_ptr uncast(const_node_ptr ptr)
    168168   {
    169       return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
     169      return node_ptr(const_cast<node*>(detail::get_pointer_no_adl(ptr)));
    170170   }
    171171
    172172   size_traits &priv_size_traits()
     
    14051405   static splaytree_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
    14061406   {
    14071407      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_);
    14091409      node_plus_pred_t *n = detail::parent_from_member
    14101410         <node_plus_pred_t, header_plus_size>(r, &node_plus_pred_t::header_plus_size_);
    14111411      data_t *d = detail::parent_from_member<data_t, node_plus_pred_t>(n, &data_t::node_plus_pred_);
  • boost/intrusive/splaytree_algorithms.hpp

     
    147147   private:
    148148   static node_ptr uncast(const_node_ptr ptr)
    149149   {
    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)));
    151151   }
    152152   /// @endcond
    153153
  • boost/intrusive/treap.hpp

     
    184184
    185185   static node_ptr uncast(const_node_ptr ptr)
    186186   {
    187       return node_ptr(const_cast<node*>(detail::get_pointer(ptr)));
     187      return node_ptr(const_cast<node*>(detail::get_pointer_no_adl(ptr)));
    188188   }
    189189
    190190   size_traits &priv_size_traits()
     
    14821482   static treap_impl &priv_container_from_end_iterator(const const_iterator &end_iterator)
    14831483   {
    14841484      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_);
    14861486      typename node_plus_pred_t::header_plus_priority_size *n =
    14871487         detail::parent_from_member
    14881488         < typename node_plus_pred_t::header_plus_priority_size
  • boost/intrusive/treap_algorithms.hpp

     
    145145
    146146   static node_ptr uncast(const_node_ptr ptr)
    147147   {
    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)));
    149149   }
    150150   /// @endcond
    151151
  • libs/intrusive/test/common_functors.hpp

     
    2929   {
    3030      typedef typename std::iterator_traits<Pointer>::value_type value_type;
    3131      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);
    3333   }
    3434};
    3535
  • libs/intrusive/test/smart_ptr.hpp

     
    303303   pt2 = ptr;
    304304}
    305305
    306 //!detail::get_pointer() enables boost::mem_fn to recognize smart_ptr.
     306//!get_pointer() enables boost::mem_fn to recognize smart_ptr.
    307307//!Never throws.
    308308template<class T>
    309309inline T* get_pointer(const smart_ptr<T>  & p)