Topic: Bug in set specification.
Author: Oleg Zabluda <zabluda@math.psu.edu>
Date: 1997/06/02 Raw View
OK, this is my second attempt to play a language lawer. It seems like
there is a bug in the set<T> specifications.
Something like this should be illegal:
set<int> s;
s.insert(1);
s.begin() = 0;
But the current DWP seems to mandate that it's legal.
1. 23.1 table 66 says that for any non-const value a of the
type "container X<T>", a.begin() returns iterator
(not const_iterator).
2. 23.3.3 says that the type of set<T>::iterator is
implementation defined.
3. 23.1.2 table 70 says that assosiative container is a container.
4. 23.1 table 66 says that for any container X<T>, X<T>::iterator
is an iterator type, pointing to T, where iterator is any
iterator category, except output iterator. 23.1.2.6 further
says that an iterator for an associative container is of a
bidirectional iterator category.
5. 24.1.3 table 75 says that if a is forward iterator, then *a
has a type T& (not const T&). Same is true for bidirectional
and random access iterators, because they are also forward
iterators (tables 76, 77)
6. 23.1 table 66 says that T must be assignable.