I tried to compile this code snippet but I got compiler error :( ! Compile with Visual Studio 2010
#include <vector>
#include <string>
#include <sstream>
#include <iterator>
#include <iostream>
using namespace std;
int main() {
    string s( "Well well on" );
    istringstream in( s );
    vector<string> v( istream_iterator<string>( in ), istream_iterator<string>() );
    copy( v.begin(), v.end(), ostream_iterator<string>( cout, "\n" ) );
}
Errors:
Error   1   error C2228: left of '.begin' must have class/struct/union  c:\visual studio 2008 projects\vector test\vector test\main.cpp 13  vector test
Error   2   error C2228: left of '.end' must have class/struct/union    c:\visual studio 2008 projects\vector test\vector test\main.cpp 13  vector test
What happened? vector was constructed correctly, how could I not be able to call it?
Best regards,
 
     
     
     
    