From 9144548271063094647
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,ee18c3926b4a832d
X-Google-Attributes: gidf78e5,public
From: Pete Becker <petebecker@acm.org>
Subject: Re: set.erase( it1, it2)
Date: 2000/11/12
Message-ID: <3A0F16B5.9DB9556B@acm.org>#1/1
X-Deja-AN: 692864016
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
References: <3A0ED736.133D060@jps.net>
X-Accept-Language: en
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Trace: mail2news.demon.co.uk 974071056 mail2news:12611 mail2news mail2news.demon.co.uk
Organization: Dinkumware, Ltd
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
Mime-Version: 1.0
NNTP-Posting-Date: 12 Nov 2000 19:15:18 GMT
Newsgroups: comp.std.c++

Dennis Yelle wrote:
> 
> Is this legal:
> 
> void f( set<char>& a, set<char>& b)
> {
>   a.erase( b.begin(), b.end());
> }
> 
> It seems to crash gcc if b is not empty.
> If not legal, where does the standard say
> that it is not legal?
> 

23.1.2/7. The arguments q1 and q2 passed to a.erase(q1, q2) must be
valid iterators to a.

-- 
Pete Becker
Dinkumware, Ltd. (http://www.dinkumware.com)
Contributing Editor, C/C++ Users Journal (http://www.cuj.com)

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]




