Possible Duplicate:
Why is it an error to use an empty set of brackets to call a constructor with no arguments?
The small piece code code can not be successfully compiled on
Microsoft Visual Studio 2005
#include <iterator>
#include <algorithm>
#include <vector>
#include <iostream>
int main()
{
std::vector<int> a;
std::istream_iterator<int> be(std::cin);
std::istream_iterator<int> en();
std::copy(be, en, std::back_inserter(a));
}
But this one is ok
#include <iterator>
#include <algorithm>
#include <vector>
#include <iostream>
int main()
{
std::vector<int> a;
std::istream_iterator<int> be(std::cin);
std::istream_iterator<int> en; //Same to upon, only here less '()'
std::copy(be, en, std::back_inserter(a));
}