🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #3105

STL sets have mutable iterators?

#3105
From: Al Hough
Date: Thu, 25 Jan 1996 05:29
19 lines
1440 bytes
In my April 95 copy of the DWP, I couldn't find any requirement
that a set iterator be a const_iterator. Previous STL documentation
required that for sets, an iterator was a const_iterator, thus
insuring that the return type from dereferencing a set<T>::iterator
was a const T& and not a T&.  I agreed with the behavior that a
set iterator should yield const T&, because yielding a T& would
allow users to break the "uniqueness" of the set by allowing the
possiblility that a user could modify an existing value in the
set so that it became equal to another value in the set.

What was intended here?

--
Al Hough                            email: hough@aai.com
Amerinex Artificial Intelligence    phone: (413) 256-8941   
---
[ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID: <9601242252.AA08579@fermat.aai.com>
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back

Show Full Headers
Complete Article Headers
From: hough@aai.com (Al Hough)
Message-ID: <9601242252.AA08579@fermat.aai.com>
X-Original-Date: Wed, 24 Jan 96 17:52:15 EST
Path: arc1-ca.pugleaf.net!in2.uu.net!bounce-back
Date: 25 Jan 96 05:29:36 GMT
Approved: fjh@cs.mu.oz.au
Organization: -
Newsgroups: comp.std.c++
Subject: STL sets have mutable iterators?
Reply-To: hough@aai.com
X-Auth: PGPMoose V1.1 PGP comp.std.c++
 iQBFAgUBMQcVS+EDnX0m9pzZAQEnvgF6AuTVk3AyTG/L4cYlHN1a4smuc8e2WEja
 +9MKk/OaH2FT9dBuEYdu/LoLtWLWlHSX
 =vAcz