This is the mail archive of the
libstdc++-prs@sourceware.cygnus.com
mailing list for the libstdc++ project.
libstdc++/42: vector<>::at() doesn't throw out_of_range
- To: libstdc++-gnats at sourceware dot cygnus dot com
- Subject: libstdc++/42: vector<>::at() doesn't throw out_of_range
- From: mikes at nilenet dot com
- Date: 15 Mar 2000 22:46:07 -0000
- Reply-To: mikes at nilenet dot com
- Resent-Cc: libstdc++-prs at sourceware dot cygnus dot com
- Resent-Reply-To: libstdc++-gnats@sourceware.cygnus.com, mikes@nilenet.com
>Number: 42
>Category: libstdc++
>Synopsis: vector<>::at() doesn't throw out_of_range
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Mar 15 14:47:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: mikes@nilenet.com
>Release: 2.90.x
>Organization:
>Environment:
i686-linux slackware, gcc compiled with namespace
>Description:
if you give vector<>::at() an out of range value, it
doesn't throw out_of_range like it should
>How-To-Repeat:
try this simple program:
#include <iostream>
#include <vector>
#include <stdexcept>
int main()try
{
std::vector<int> myvec(2);
std::cout << myvec.at(2) << std::endl;
}
catch(std::out_of_range)
{
std::cerr << "out of range" << std::endl;
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: