This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/29787] std::vector can access negative value (std runtime bug?)



------- Comment #1 from fang at csl dot cornell dot edu  2006-11-09 23:37 -------
If you want bounds checking on std::vector, use the "at()" member function in
place of operator[].  
Otherwise, the overloaded operator[] is unchecked and just does a plain
indexed-array reference.  
(If it is out-of-bounds, an exception will be thrown.)


-- 

fang at csl dot cornell dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fang at csl dot cornell dot
                   |                            |edu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29787


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