Date: Mon, 12 Aug 2002 10:13:48 +0300 (WET) From: Andris Pavenis X-Sender: pavenis AT ieva06 To: Alex Vinokur Cc: djgpp AT delorie DOT com Subject: Re: istream_iterator, ostream_iterator and gcc/gpp-3.1 In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 10 Aug 2002, Alex Vinokur wrote: > ============ > Windows 2000 > DJGPP 2.03 > gcc/gpp 3.1 > ============ > > > The code below has no problem with gcc/gpp 3.0.4. > > However it does have a problem with gcc/gpp 3.1. > > What has been changed concerning istream_iterator and ostream_iterator ? > > ######### C++ code : BEGIN ######### > // File t1.cpp > > #include > #include > #include > #include > #include missing '#include ' (I also have met this problem) Andris > using namespace std; > > // ============================== > int main (int argc, char** argv) > { > string file_line; > > if (!(argc > 1)) > { > cout << "FATAL ERROR !" > << endl; > > cout << " Usage : " > << argv[0] > << " " > << "" > << endl; > return 1; > } > assert (argc > 1); > > ifstream fin (argv[1]); > assert (fin); > > > cout << endl; > cout << "\t-----------------------" << endl; > cout << "\t--- File " << argv[1] << endl; > cout << "\t-----------------------" << endl; > > for (int i = 1; getline (fin, file_line); i++) > { > vector file_vline; > istringstream isstr (file_line.c_str ()); > > copy( > istream_iterator(isstr), > istream_iterator (), > back_inserter (file_vline) > ); > > cout << "\t Line#" << i << " ---> "; > copy ( > file_vline.begin (), > file_vline.end (), > ostream_iterator (cout, " # ") > ); > cout << endl; > > > } // while > > cout << "\t-----------------------" << endl; > > } > > > ######### C++ code : END ########### > > > ######### Compilation : BEGIN ######### > > %gpp t1.cpp > > T1.CPP: In function `int main(int, char**)': > T1.CPP:43: `istream_iterator' undeclared (first use this function) > T1.CPP:43: (Each undeclared identifier is reported only once for each function > it appears in.) > T1.CPP:43: parse error before `>' token > T1.CPP:52: `ostream_iterator' undeclared (first use this function) > T1.CPP:52: parse error before `>' token > > > ######### Compilation : END ###########