STL list question

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Dec 2008
Posts: 2
Reputation: dwhite409 is an unknown quantity at this point 
Solved Threads: 0
dwhite409 dwhite409 is offline Offline
Newbie Poster

STL list question

 
0
  #1
Dec 30th, 2008
If you recall in the implementation of list:


struct list_node_base {
list_node_base* next
list_node_base* prev

...

void hook(const list_node_base*);

....
};

I wanted to look under the hood of the hook function, but can't find it anywhere in the STL library or any reference to this method via Google for that matter. All that Google pulls up are copies of <list>, which, duh, I'm looking at...

If you know how how the hook method works and could even just pseudo code it for me I'd appreciate it.

Much thanks
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,357
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1462
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Still Learning

Re: STL list question

 
0
  #2
Dec 31st, 2008
why do you think that function is part of stl library?
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: STL list question

 
0
  #3
Dec 31st, 2008
it's not STL, it's libstdc++, list.cc module:
http://www.cs.brown.edu/~jwicks/libs...cc-source.html
  1. 00123 void
  2. 00124 _List_node_base::hook(_List_node_base* const __position)
  3. 00125 {
  4. 00126 this->_M_next = __position;
  5. 00127 this->_M_prev = __position->_M_prev;
  6. 00128 __position->_M_prev->_M_next = this;
  7. 00129 __position->_M_prev = this;
  8. 00130 }
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 320
Reputation: cikara21 is an unknown quantity at this point 
Solved Threads: 63
cikara21's Avatar
cikara21 cikara21 is offline Offline
Posting Whiz

Re: STL list question

 
0
  #4
Dec 31st, 2008
.:-cikara21-:.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 2
Reputation: dwhite409 is an unknown quantity at this point 
Solved Threads: 0
dwhite409 dwhite409 is offline Offline
Newbie Poster

Re: STL list question

 
0
  #5
Jan 3rd, 2009
A ha! Thank you very much for your replies!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC