Re: removing multiple values in a set
- From: "Igor Tandetnik" <itandetnik@xxxxxxxx>
- Date: Tue, 15 May 2007 11:31:21 -0400
SvenC <SvenC@xxxxxxxxxxxxxxxx> wrote:
if(result.Compare("Error")==0) {
remotenodeip.erase(itr++); // must use post-increment
I would prefer to use the return value as it was designed to return a
valid iterator:
itr = remotenodeip.erase(itr);
According to the C++ standard, set::erase returns void, so your code is
non-portable. For more details, see
http://groups.google.com/group/microsoft.public.vc.stl/browse_frm/thread/4fe24e875127a3e5/c12ac74b8360c21b
in particular the last five posts in that thread.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
.
- References:
- Re: removing multiple values in a set
- From: Igor Tandetnik
- Re: removing multiple values in a set
- From: SvenC
- Re: removing multiple values in a set
- Prev by Date: Re: removing multiple values in a set
- Next by Date: string replacing
- Previous by thread: Re: removing multiple values in a set
- Next by thread: string replacing
- Index(es):
Loading