public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: AW: STL - How to use iterators?
       [not found] <28D6CEAEAB8BD211ADD300A0C9D5B739FB2B5D@r4667.erlf.siemens.de>
@ 2000-02-15  2:36 ` Ivan Martinez
  2000-04-01  0:00   ` Ivan Martinez
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan Martinez @ 2000-02-15  2:36 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]

May Adrian wrote:
> class A
> {
>     public:
>         ...
>         int number;
            
A(int n):number(n){}
> }
>
>
> main (int argc, char *argv []) {
>     list<A> l;
>     A a1(10), a2(20), a3(30);
>     l.push_back (a1);
>     l.push_back (a2);
>     l.push_back (a3);
>
       //notice !=, not < ...
       for (list<A>::iterator i =
l.begin();i != l.end() ; i++)
               
cout << (*i).number << endl;
        }
On the one hand "i" is a "list<A>::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"
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: AW: STL - How to use iterators?
  2000-02-15  2:36 ` AW: STL - How to use iterators? Ivan Martinez
@ 2000-04-01  0:00   ` Ivan Martinez
  0 siblings, 0 replies; 2+ messages in thread
From: Ivan Martinez @ 2000-04-01  0:00 UTC (permalink / raw)
  To: gcc-help

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1022 bytes --]

May Adrian wrote:
> class A
> {
>     public:
>         ...
>         int number;
            
A(int n):number(n){}
> }
>
>
> main (int argc, char *argv []) {
>     list<A> l;
>     A a1(10), a2(20), a3(30);
>     l.push_back (a1);
>     l.push_back (a2);
>     l.push_back (a3);
>
       //notice !=, not < ...
       for (list<A>::iterator i =
l.begin();i != l.end() ; i++)
               
cout << (*i).number << endl;
        }
On the one hand "i" is a "list<A>::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"
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2000-04-01  0:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <28D6CEAEAB8BD211ADD300A0C9D5B739FB2B5D@r4667.erlf.siemens.de>
2000-02-15  2:36 ` AW: STL - How to use iterators? Ivan Martinez
2000-04-01  0:00   ` Ivan Martinez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).