ok, there is an istream_iterator like istream_iterator<int>(cin). what i need is an ifstream_iterator for a file like istream_iterator<int>(datafile). my code works when cin is used, however failes when i try to use a datafile. if anybody knows of a nifty trick to convert a class std::basic_ifstream<char,struct std::char_traits<char> to a class std::basic_istream<char,struct std::char_traits<char> >, so i can use a istream_iterator with a converted ifstream object, or an ifstream iterator (i checked and didnt see one) im very interested in hearing about it. thanks.