Article View: comp.std.c++
Article #2892Containers and exceptions
From: Marian Hellema
Date: Wed, 06 Dec 1995 18:51
Date: Wed, 06 Dec 1995 18:51
31 lines
1505 bytes
1505 bytes
Hello, I am wondering if any of the containers in the standard library can throw exceptions. In the working paper the only container for which exceptions are specified is bitset. This suggests that none of the other containers throws exceptions. If this is correct: why not? It would seem reasonable to me, for example: vector's operator[] throws an exception if you use an index greater than the size() of the vector. (Similar to the class string, whose memberfunction at() can throw out_of_range). Or: a length_error exception if you try to resize a container to a size which exceeds max_size(). (Again: similar to class string). Thanks, Marian -- ---------------------------------------------------------------------- Marian Hellema AT Computing, UNIX training and consultancy email: marian@atcmp.nl P.O. Box 1428, 6501 BK Nijmegen phone: +31 24 3527225 the Netherlands --- [ 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:
<4a3o1h$ke0@info.uci.kun.nl>Path:
arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!MattShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt From: Marian Hellema <marian@atcmp.nl> Newsgroups: comp.std.c++ Subject: Containers and exceptions Date: 06 Dec 1995 18:51:57 GMT Organization: AT Computing, Nijmegen, the Netherlands Approved: Matt@Austern Message-ID: <4a3o1h$ke0@info.uci.kun.nl> NNTP-Posting-Host: austern.hip.berkeley.edu