From 3578229107364561415
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,7eaa8faac8da5016
X-Google-Attributes: gidf78e5,public
From: Pete Becker <petebecker@acm.org>
Subject: Re: Defect Report: member == in container iterators considered harmful
Date: 1999/08/19
Message-ID: <37BB7254.1630ED8F@acm.org>#1/1
X-Deja-AN: 514601029
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <7p4nj8$n3u@enews4.newsguy.com> <37B98C2E.E3A1EA71@acm.org> <7pcr52$2mh8@enews2.newsguy.com>
X-Original-Date: Wed, 18 Aug 1999 22:56:20 -0400
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: izvestia.its.unimelb.edu.au 935051271 17783 128.250.29.17 (19 Aug 1999 08:27:51 GMT)
Organization: Road Runner
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAN7u/7uEDnX0m9pzZAQGuRQF9FZTVYKLPUQzh0CkJmBEWd1zmfUzC/ke3 ZSkzuSzYLnOP3Z7h2ZG1lXLOMyXkkwlG =+9de
Mime-Version: 1.0
NNTP-Posting-Date: 19 Aug 1999 08:27:51 GMT
Newsgroups: comp.std.c++

Darin Adler wrote:
> 
> With the standard STL idioms, there is no reason to convert between
> iterators and const_iterators. If you are operating on a modifiable
> container, you use iterators. If it's a const reference to the container,
> then you use const_iterators. Why, then, does the standard require a
> conversion from iterator to const_iterator for the container classes?
> 

Because constness was not part of the original design of STL, but was
force-fit into it as part of the standardization process. (The original
STL did not have const_iterators) I'm not convinced that hacking around
with the requirements of operator== will fix the problems that STL has
with constness.

-- 
Pete Becker
Dinkumware, Ltd.
http://www.dinkumware.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://reality.sgi.com/austern_mti/std-c++/faq.html              ]



