help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: std::set::erase(iterator) missing return value


From: JH Trauntvein
Subject: Re: std::set::erase(iterator) missing return value
Date: 4 Aug 2006 12:05:47 -0700
User-agent: G2/0.2

Thomas Krebs wrote:
> Ulrich Eckhardt schrieb:
> > Thomas Krebs <Thomas_Krebsatgmxdotde> wrote:
> >> trying to port some code to Fedora Core 5 with installed gcc 4.1.0 I
> >> found that std::set::erase(iterator) returns void.
> >> I don't have the standard document, but should this method return
> >> the position to the next element in the set?
> >
> > It's a piece that was not adopted from the STL, the standard says it
> > returns void. Workaround is typically to use the postincrement operator on
> > the passed iterator.
> >
> > Just wondering, what standardlibrary are you porting from?
> >
>
> VC 7.1, returns the incremented iterator...

I remember asking about this some time ago and received the answer from
DinkumWare (VC's std library supplier) that the return value from erase
is a "conforming extension".  As such, you cannot expect code that
relies upon it to be portable.

Regards,

Jon Trauntvein



reply via email to

[Prev in Thread] Current Thread [Next in Thread]