You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@stdcxx.apache.org by Mark Lee <cs...@gmail.com> on 2008/07/03 04:07:38 UTC

std::istream_iterator::iterator ??

I saw strange example in Apache C++ Standard Library User's Guide

http://stdcxx.apache.org/doc/stdlibug/2-3.html
http://stdcxx.apache.org/doc/stdlibug/2-3.html 

std::istream_iterator<int, char>::iterator where = std::find(intstream, eof,
7);

I didn't compile this example.  

I don't understand why it need ::itrerator and why compiler didn't compile
it?

Is it wrong example?

Rogue-wave's documents show this example, too

http://www2.roguewave.com/support/docs/sourcepro/edition9-update1/html/stdlibug/2-3.html
http://www2.roguewave.com/support/docs/sourcepro/edition9-update1/html/stdlibug/2-3.html 
-- 
View this message in context: http://www.nabble.com/std%3A%3Aistream_iterator%3A%3Aiterator----tp18250458p18250458.html
Sent from the stdcxx-user mailing list archive at Nabble.com.


Re: std::istream_iterator::iterator ??

Posted by Martin Sebor <se...@roguewave.com>.
Mark Lee wrote:
> I saw strange example in Apache C++ Standard Library User's Guide
> 
> http://stdcxx.apache.org/doc/stdlibug/2-3.html
> http://stdcxx.apache.org/doc/stdlibug/2-3.html 
> 
> std::istream_iterator<int, char>::iterator where = std::find(intstream, eof,
> 7);
> 
> I didn't compile this example.  
> 
> I don't understand why it need ::itrerator and why compiler didn't compile
> it?
> 
> Is it wrong example?

Yes, it's a typo. I opened an issue to remind us to fix it:
   http://issues.apache.org/jira/browse/STDCXX-986

Feel free to add your comments to the issue, or subscribe
to it to get email notifications of any changes.

Thanks for pointing it out!
Martin

> 
> Rogue-wave's documents show this example, too
> 
> http://www2.roguewave.com/support/docs/sourcepro/edition9-update1/html/stdlibug/2-3.html
> http://www2.roguewave.com/support/docs/sourcepro/edition9-update1/html/stdlibug/2-3.html