Topic: Should bitset::operator[] throw out_of_range?


Author: Ray Lischner <dontspamme@spam.you>
Date: Tue, 19 Feb 2002 21:07:13 GMT
Raw View
The standard omits a description of bitset::operator[], but DR 11 adds the
missing description. It says that operator[] require "pos is valid" and
that it throws "nothing." Stroustrup explicitly states that the subscript
operator throws out_of_range and that "there is no unchecked subscript
operation." I think DR 11 should be explicit about what happens if the bit
position is invalid: either it throws out_of_range or the behavior is
undefined.
--
Ray Lischner, author of C++ in a Nutshell (forthcoming, Q4 2002)
http://www.tempest-sw.com/cpp/

---
[ 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.research.att.com/~austern/csc/faq.html                ]