I've got this code snippet. The istream_iterator object is only defined and not used, so I expect that it won't do anything and application finish immediately. But when I run application, it will not finish before I provide some input. Why?
I'm compiling it on ArchLinux with: gcc 4.7.1, with command: g++ -std=c++11 filename.cpp
#include <iterator>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
istream_iterator<char> input(cin);
return 0;
}