From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Martinez To: gcc-help@gcc.gnu.org Subject: Re: AW: STL - How to use iterators? Date: Tue, 15 Feb 2000 02:36:00 -0000 Message-id: <38A92C6D.9C28C0E@kalman.iau.dtu.dk> References: <28D6CEAEAB8BD211ADD300A0C9D5B739FB2B5D@r4667.erlf.siemens.de> X-SW-Source: 2000-02/msg00051.html May Adrian wrote: > class A > { >     public: >         ... >         int number;              A(int n):number(n){} > } > > > main (int argc, char *argv []) { >     list l; >     A a1(10), a2(20), a3(30); >     l.push_back (a1); >     l.push_back (a2); >     l.push_back (a3); >        //notice !=, not < ...        for (list::iterator i = l.begin();i != l.end() ; i++)                 cout << (*i).number << endl;         } On the one hand "i" is a "list::iterator". Ont the other docs tell about "iterator_traits", "input_iterator_tag", "bidirectional_iterator"... What type is "iterator"? --  Ivan Martinez (Rodriguez) Bch in Computer Science - MSc student http://www.student.dtu.dk/~u990873 "Ponia Windows98 o superior, asi que instale Linux"   From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ivan Martinez To: gcc-help@gcc.gnu.org Subject: Re: AW: STL - How to use iterators? Date: Sat, 01 Apr 2000 00:00:00 -0000 Message-ID: <38A92C6D.9C28C0E@kalman.iau.dtu.dk> References: <28D6CEAEAB8BD211ADD300A0C9D5B739FB2B5D@r4667.erlf.siemens.de> X-SW-Source: 2000-q1/msg00245.html Message-ID: <20000401000000.FNhkHexDDa9RTDZA8wjmkDzqRa7rhxog9rdrPXDHjVE@z> May Adrian wrote: > class A > { >     public: >         ... >         int number;              A(int n):number(n){} > } > > > main (int argc, char *argv []) { >     list l; >     A a1(10), a2(20), a3(30); >     l.push_back (a1); >     l.push_back (a2); >     l.push_back (a3); >        //notice !=, not < ...        for (list::iterator i = l.begin();i != l.end() ; i++)                 cout << (*i).number << endl;         } On the one hand "i" is a "list::iterator". Ont the other docs tell about "iterator_traits", "input_iterator_tag", "bidirectional_iterator"... What type is "iterator"? --  Ivan Martinez (Rodriguez) Bch in Computer Science - MSc student http://www.student.dtu.dk/~u990873 "Ponia Windows98 o superior, asi que instale Linux" Â