From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28269 invoked by alias); 25 Oct 2002 15:57:59 -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 28221 invoked from network); 25 Oct 2002 15:57:57 -0000 Received: from unknown (HELO smtp3.cern.ch) (137.138.131.164) by sources.redhat.com with SMTP; 25 Oct 2002 15:57:57 -0000 Received: from lxplus024.cern.ch (IDENT:root@lxplus024.cern.ch [137.138.139.119]) by smtp3.cern.ch (8.12.1/8.12.1) with ESMTP id g9PFvshE022701; Fri, 25 Oct 2002 17:57:54 +0200 (MET DST) Received: from localhost (graboso@localhost) by lxplus024.cern.ch (8.9.3/8.9.3) with SMTP id RAA24334; Fri, 25 Oct 2002 17:57:54 +0200 X-Authentication-Warning: lxplus024.cern.ch: graboso owned process doing -bs Date: Fri, 25 Oct 2002 08:57:00 -0000 From: Alberto Garcia Raboso X-Sender: graboso@lxplus024.cern.ch To: "Moore, Mathew L" cc: "'Alberto Garcia Raboso'" , gcc-help@gcc.gnu.org Subject: RE: STL iterators in gcc 3.2 In-Reply-To: <2F05A390F72A0A409390E016D23E45E8042DBECB@ns-bco-mse4.im.battelle.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2002-10/txt/msg00321.txt.bz2 > > From what I've noticed, the old 2.95 implemented std::vector iterators as > just plain pointers (|std::vector| used |double*|'s for iteration). > It looks like now the library is using class abstractions for its iterators. > This has many benefits, but it also means that some code, e.g., > > void foo(double*); > std::vector myvect; > foo(myvect.begin()); > > will no longer work, since |myvect.begin()| does not necessarily produce a > double*. > > I have found in order to make your code independent of the iterator object, > you have to either use templates, > > template > void foo(OutputIterator); > > or you must specifically use the iterator type defined by your container, > > void foo(std::vector::iterator); > > I don't know if there is an easier conversion than either of these, but I > would be interested in hearing any other ideas. Of course, this explains vey well he problem. But I cannot use new definitions of the methods using template arguments instead of pointers, as they come from a library... So I think I'll have to use a previous version of gcc, at least until I have time to change my code to adhere to the standards ;-) Anyway, thank you very much. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Alberto Garcia Raboso CERN / EP CH-1211 Geneva 23, Switzerland Office 40-2B-19 (+41 22 76 71626) E-Mail: Alberto.Garcia.Raboso@cern.ch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Well, farewell, my hobbits! You should come safe to your own homes now, and I shall not be kept awake for fear of your peril. We will send word when we may, and some of us may yet meet at times; but I fear that we shall not all be gathered together ever again. The return of the King. J.R.R. Tolkien ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~