Thread View: comp.std.c++
1 messages
1 total messages
Started by Al Hough
Thu, 25 Jan 1996 05:29
STL sets have mutable iterators?
Author: Al Hough
Date: Thu, 25 Jan 1996 05:29
Date: Thu, 25 Jan 1996 05:29
19 lines
1440 bytes
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. ]
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads