From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17323 invoked by alias); 24 May 2003 12:50:04 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 17286 invoked from network); 24 May 2003 12:50:03 -0000 Received: from unknown (HELO lifesupport.shutdown.com) (66.93.79.177) by sources.redhat.com with SMTP; 24 May 2003 12:50:03 -0000 Received: (from llewelly@localhost) by lifesupport.shutdown.com (8.11.2/8.11.2) id h4OCkSX16591; Sat, 24 May 2003 05:46:28 -0700 (PDT) To: MR Cc: gcc-help@gcc.gnu.org Subject: Re: RedHat 8.0 `istream_iterator' undeclared (first use this function) References: <20030224045442.GA25932@uol.com.br> <1053775198.2190.10.camel@nimrod> From: LLeweLLyn Reese Date: Sat, 24 May 2003 12:50:00 -0000 In-Reply-To: <1053775198.2190.10.camel@nimrod> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-05/txt/msg00212.txt.bz2 MR writes: > Hello STL gurus, > > > I have a bit of a problem getting my iterators to work with libstdc++ > 3.2-7 (redhat 8.0), GCC 3.2. > > with a very simple program (merges two files): > > #include > #include > #include #include Stream iterators are in this header. See the synopsis in 24.2, or 24.5 . > > using namespace std; > > main(int argc, char**argv) { int main(int argc, char**argv) { > if (argc < 3) { > > cout << "You must supply two input files.\n"; > > exit(1); > } > > ifstream in1(argv[1]), in2(argv[2]); > if(!in1||!in2) { > cout << "File open error\n"; > exit(1); > } > > merge( > istream_iterator(in1), > istream_iterator(), > istream_iterator(in2), > istream_iterator(), > ostream_iterator(cout, "\n") > ); > return 0; > }