From stdcxx-dev-return-2607-apmail-incubator-stdcxx-dev-archive=incubator.apache.org@incubator.apache.org Tue Feb 13 19:24:39 2007 Return-Path: Delivered-To: apmail-incubator-stdcxx-dev-archive@www.apache.org Received: (qmail 4064 invoked from network); 13 Feb 2007 19:24:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Feb 2007 19:24:38 -0000 Received: (qmail 10099 invoked by uid 500); 13 Feb 2007 19:24:46 -0000 Delivered-To: apmail-incubator-stdcxx-dev-archive@incubator.apache.org Received: (qmail 10086 invoked by uid 500); 13 Feb 2007 19:24:46 -0000 Mailing-List: contact stdcxx-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: stdcxx-dev@incubator.apache.org Delivered-To: mailing list stdcxx-dev@incubator.apache.org Received: (qmail 10075 invoked by uid 99); 13 Feb 2007 19:24:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 11:24:45 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [212.82.213.172] (HELO exkiv.kyiv.vdiweb.com) (212.82.213.172) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Feb 2007 11:24:35 -0800 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH] Fix of STDCXX-268, STDCXX-331 Date: Tue, 13 Feb 2007 21:24:11 +0200 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] Fix of STDCXX-268, STDCXX-331 thread-index: AcdLGXXfcEOKg9aEQ5igYWrynL0Q3wDsLvuw References: <45C9F602.5050804@kyiv.vdiweb.com> <45CA7087.6050903@roguewave.com> From: "Farid Zaripov" To: X-Virus-Checked: Checked by ClamAV on apache.org > -----Original Message----- > From: Martin Sebor [mailto:sebor@roguewave.com]=20 > Sent: Thursday, February 08, 2007 2:36 AM > To: stdcxx-dev@incubator.apache.org > Subject: Re: [PATCH] Fix of STDCXX-268, STDCXX-331 >=20 > Farid Zaripov wrote: > > Attached is a proposed patch for fix the bugs STDCXX-268=20 > and STDCXX-331. >=20 > If the bodies of the functions are the same wouldn't be=20 > better to call one from the other rather than introducing the macro? > (The macro makes it impossible to step through the functions=20 > in most debuggers. I know we have macros in there already but=20 > we don't need to make things worse by adding more :) I agree that it would be better. > Or are we invoking the macro with arguments of different=20 > types each time (Iterator, pointer, const_pointer) because=20 > we're working around the lack of member templates? Yes. If _RWSTD_NO_INLINE_MEMBER_TEMPLATES macro is defined then the range form of the method insert is present twice with types const_pointer and const_iterator. > (We should discuss and decide if we want to keep these workarounds or if=20 > it's time to get rid of them and assume that the compiler is reasonably modern). I don't have the compiler without supporting the inline mebmer templates. We need to make the list of the compilers without supporting the inline member templates and then decide. > Btw., I wonder if we could simplify (optimize) this code so=20 > as to call erase(__start, __it) in the catch block instead of=20 > looping (the idea is that the range form of erase() might be=20 > more efficient than calling the single form repeatedly): Yes, but to get __start we need use loop or std::advance, because __start =3D __it - __n. iterator __start =3D __it; std::advance (__start, -n); erase (__start, __it); Another approach is to remember the iterator after first successful insert (__it, *__first) operation. What do you prefer? Farid.