From 5863621488759556986
X-Google-Thread: f78e5,b58c7d21316b534b,start
X-Google-Attributes: gidf78e5,public
X-Google-Language: ENGLISH,ASCII-7-bit
Path: g2news2.google.com!news1.google.com!news4.google.com!news2.volia.net!solnet.ch!solnet.ch!feeder.ecngs.de!ecngs!feeder2.ecngs.de!213.131.161.21.MISMATCH!peer1.news.newnet.co.uk!194.159.246.34.MISMATCH!peer-uk.news.demon.net!kibo.news.demon.net!news.demon.co.uk!demon!stump.algebra.com!devnull
From: slobasso@yahoo.com (Steve LoBasso)
Newsgroups: comp.std.c++
Subject: deficiency in standard at 23.2.1.3/4 [deque end invalidation during erase]
Date: Sat, 17 Feb 2007 08:51:59 GMT
Lines: 36
Sender: mail2news@demon.net
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <20070217053239.55114.qmail@web51505.mail.yahoo.com>
NNTP-Posting-Host: news.news.demon.net
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.demon.co.uk 1171702330 11608 158.152.254.254 (17 Feb 2007 08:52:10 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sat, 17 Feb 2007 08:52:10 +0000 (UTC)
X-Original-To: std-c++@mailman.ucar.edu
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com;
  h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding;
  b=1eDlou1dY9PT2wIf5lqg2hRXZhXwF6xlWvFICuOJIQCYbBh0odPiyPmg7rjXml+/WZAm/My9sbOnt04PwB/E/QgB4/lGpOKCBJwpfTLkhemKSC5mlVPCf2RlA9f16Ubh9RyUUwNF/mC9o+BdEyjDbvlSm7uXQpsDKwb4pvJUP/s=  ;
X-MIME-Autoconverted: from quoted-printable to 8bit by mulga.csse.unimelb.edu.au id l1H5dPUw004736
X-Virus-Scanned: amavisd-new at csse.unimelb.edu.au
X-Received: (from fjh@localhost)
	by mulga.csse.unimelb.edu.au (8.13.8+Sun/8.13.8/Submit) id l1H8px2v025811;
	Sat, 17 Feb 2007 19:51:59 +1100 (EST)
X-Path: comp-std-cpp-robomod!not-for-mail
X-YMail-OSG: hSjnaG8VM1nfuDYQEV6TS7ctieLuLFe7QulCvSsn_sqvEwyj6oONJDv3d3XkESf1yBW3sZ7swylkSgQVrlsQRsFhgPCWuS6j6I0WFN8V25MNFfdXvaMTQJZbR.OsiA9BVXNerHPxF85jUPV0FxKrgK6hfyHTB4ytnca33dZ3P2KPt1lL5F9HjCKGlEovkQ--
X-Delivered-To: std-c++@mailman.ucar.edu
X-Authentication-Warning: mulga.csse.unimelb.edu.au: fjh set sender to devnull@stump.algebra.com using -f
X-Newsgroups: comp.std.c++
Xref: g2news2.google.com comp.std.c++:5615

The standard states at 23.2.1.3/4:

deque erase(...)
 
Effects: ... An erase at either end of the deque invalidates only the iterators and the references to the erased elements.

This does not state that iterators to end will be invalidated.
It needs to be amended in such a way as to account for end invalidation.

Something like:
Any time the last element is erased, iterators to end are invalidated.

This would handle situations like:
erase(begin(), end())
erase(end() - 1)
pop_back()
resize(n, ...) where n < size()

pop_front() with size() == 1

   -Steve



 
____________________________________________________________________________________
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 

---
[ 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.comeaucomputing.com/csc/faq.html                      ]



