This is the mail archive of the libstdc++-prs@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

libstdc++/42: vector<>::at() doesn't throw out_of_range



>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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]