public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ivan Martinez <ex08@kalman.iau.dtu.dk>
To: gcc-help@gcc.gnu.org
Subject: Re: AW: STL - How to use iterators?
Date: Tue, 15 Feb 2000 02:36:00 -0000	[thread overview]
Message-ID: <38A92C6D.9C28C0E@kalman.iau.dtu.dk> (raw)
In-Reply-To: <28D6CEAEAB8BD211ADD300A0C9D5B739FB2B5D@r4667.erlf.siemens.de>

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"
 

WARNING: multiple messages have this Message-ID
From: Ivan Martinez <ex08@kalman.iau.dtu.dk>
To: gcc-help@gcc.gnu.org
Subject: Re: AW: STL - How to use iterators?
Date: Sat, 01 Apr 2000 00:00:00 -0000	[thread overview]
Message-ID: <38A92C6D.9C28C0E@kalman.iau.dtu.dk> (raw)
Message-ID: <20000401000000.FNhkHexDDa9RTDZA8wjmkDzqRa7rhxog9rdrPXDHjVE@z> (raw)
In-Reply-To: <28D6CEAEAB8BD211ADD300A0C9D5B739FB2B5D@r4667.erlf.siemens.de>

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"
 

       reply	other threads:[~2000-02-15  2:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <28D6CEAEAB8BD211ADD300A0C9D5B739FB2B5D@r4667.erlf.siemens.de>
2000-02-15  2:36 ` Ivan Martinez [this message]
2000-04-01  0:00   ` Ivan Martinez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=38A92C6D.9C28C0E@kalman.iau.dtu.dk \
    --to=ex08@kalman.iau.dtu.dk \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).