std::istream_iterator::iterator ??

View: New views
2 Messages — Rating Filter:   Alert me  

std::istream_iterator::iterator ??

by Mark Lee :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

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

Re: std::istream_iterator::iterator ??

by Martin Sebor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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