Click to See Complete Forum and Search --> : Question about STL output iterator.


George2
February 4th, 2003, 03:21 AM
Hi, everyone!

My STL tutorial says,

--------
Assignment through the same value of the iterator should happen only once.

ostream_iterator<int> r (cout);
*r = 0;
*r = 1;

is not a valid code sequence.
--------

But I tried the above code sample, it works OK!
The output is 0 and 1.

What is the meaning of the tutorial?


Thanks in advance,
George

Wfranc
February 4th, 2003, 04:48 AM
I think if you have tried out the code and found out it worked fine, you have to say straight outloud that your tutorial is in skepticism.
Okay, there might be another way to explain the situation, first you cout the first value of r and then when it is given by the second value, it once again put this out up onto the screen. :D Is that correct ? GEORGE ?



Regards,

George2
February 4th, 2003, 05:14 AM
Hi, Wfranc buddies!

I simply do not understand what the turorial is
talking about. (As you can see in the following)

--------
Assignment through the same value of the iterator should happen only once.
--------

Can you explain it to me? Someone told me that VC is
not a standard implementation of STL and I just have
good luck when running the code.

So, I really what to know what is the tutorial talking about.


Thanks in advance,
George

Wfranc
February 4th, 2003, 05:46 AM
I think the code works fine. And therefore,
--------
Assignment through the same value of the iterator should happen only once.

ostream_iterator<int> r (cout);
*r = 0;
*r = 1;

is not a valid code sequence.
--------


when you just give out such a piece of information, it might not be a correct tutorial. But it might be another answer if you give some other information above this. .:D



Best Regards,

George2
February 4th, 2003, 05:59 AM
Hi, Wfranc buddies!

I have added the whole tutorial as the attachment
of the reply.

My trouble arises on page line 16, page32.

Can you explain the meaning of the tutorial to
me? The tutorial is the first tutorial google gives
to me. :-)


Thanks in advance,
George

Wfranc
February 5th, 2003, 01:48 AM
I sent you an PM already. Check and reply !!!




Best Regards,

George2
February 5th, 2003, 07:20 AM
Thanks, Wfranc buddies!

I have sent you the reply. Please read it.


Cheers,
George