15,848,407 members
Home / Discussions / ATL / WTL / STL

# ATL / WTL / STL

 First PrevNext
 HOW TO ANSWER A QUESTION Chris Maunder16-Jul-09 4:09 Chris Maunder 16-Jul-09 4:09
 How to get an answer to your question Chris Maunder16-Jul-09 4:05 Chris Maunder 16-Jul-09 4:05
 AI Ted Snyders18-Nov-23 10:52 Ted Snyders 18-Nov-23 10:52
 Re: AI RedDk18-Nov-23 15:44 RedDk 18-Nov-23 15:44
 Help with STL list::insert ForNow21-Sep-22 2:54 ForNow 21-Sep-22 2:54
 Re: Help with STL list::insert Graham Breach21-Sep-22 22:40 Graham Breach 21-Sep-22 22:40
 Re: Help with STL list::insert ForNow22-Sep-22 2:35 ForNow 22-Sep-22 2:35
 Re: Help with STL list::insert Graham Breach22-Sep-22 4:40 Graham Breach 22-Sep-22 4:40
 Re: Help with STL list::insert ForNow22-Sep-22 5:31 ForNow 22-Sep-22 5:31
 Re: Help with STL list::insert Graham Breach22-Sep-22 5:59 Graham Breach 22-Sep-22 5:59
 When you want to traverse the list get an iterator with `begin()`. This is the first element in the list. Access the information you need, then increment the iterator. If it is equal to `end()` then you have reached (one item past) the end of the list: C++ ```for(auto i = my_list.begin(); i != my_list.end(); ++i) { // do something with iterator i std::cout << "Item " << i->name << "\n"; } ``` Or you could use range-based for: C++ ```for(auto& i : my_list) { // do something with i, which is a reference to the item in the list std::cout << "Item " << i.name << "\n"; } ```
 Re: Help with STL list::insert ForNow22-Sep-22 6:11 ForNow 22-Sep-22 6:11
 Re: Help with STL list::insert Richard MacCutchan22-Sep-22 5:51 Richard MacCutchan 22-Sep-22 5:51
 Re: Help with STL list::insert ForNow22-Sep-22 10:30 ForNow 22-Sep-22 10:30
 Re: Help with STL list::insert Richard MacCutchan22-Sep-22 23:28 Richard MacCutchan 22-Sep-22 23:28
 Re: Help with STL list::insert ForNow23-Sep-22 2:45 ForNow 23-Sep-22 2:45
 Re: Help with STL list::insert Richard MacCutchan23-Sep-22 2:55 Richard MacCutchan 23-Sep-22 2:55
 Re: Help with STL list::insert ForNow23-Sep-22 3:20 ForNow 23-Sep-22 3:20
 Re: Help with STL list::insert Richard MacCutchan23-Sep-22 4:16 Richard MacCutchan 23-Sep-22 4:16
 Re: Help with STL list::insert ForNow23-Sep-22 5:11 ForNow 23-Sep-22 5:11
 Re: Help with STL list::insert Richard MacCutchan23-Sep-22 5:38 Richard MacCutchan 23-Sep-22 5:38
 Re: Help with STL list::insert ForNow23-Sep-22 5:48 ForNow 23-Sep-22 5:48
 Message Closed 19-Jul-22 6:14 Member 14968771 19-Jul-22 6:14
 Re: error: cannot call member function ‘bool QRegExp::exactMatch(const QString&) const’ without object jsc4219-Jul-22 7:35 jsc42 19-Jul-22 7:35
 /std:c++20 broke a template class Member 1567106212-Jun-22 11:07 Member 15671062 12-Jun-22 11:07
 Re: /std:c++20 broke a template class longjmp24-Nov-22 3:59 longjmp 24-Nov-22 3:59
 Last Visit: 31-Dec-99 19:00     Last Update: 28-Feb-24 12:17 Refresh 1234567891011 Next ᐅ