<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Elliott Back's Blog - Latest Comments in C++ and the bad_alloc exception &amp;mdash; Elliott C. Back</title><link>http://elliottbacksblog.disqus.com/</link><description></description><language>en</language><lastBuildDate>Sun, 28 May 2006 17:04:00 -0000</lastBuildDate><item><title>Re: C++ and the bad_alloc exception &amp;mdash; Elliott C. Back</title><link>http://elliottback.com/wp/c-and-the-bad_alloc-exception/#comment-3187326</link><description>Quote: "Calling [] on a vector apparently returns *(begin() + offset), which when the offset is larger than the size points to invalid memory."&lt;br&gt;&lt;br&gt;And that yields undefined behaviour, which means that anything can happen, including a bad_alloc exception being thrown. This is no way to "invoke that behaviour", and it does not contradict the standard either. It's simply a blunt mistake that should not happen, just like dereferencing a NULL pointer.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Matthias Hofmann</dc:creator><pubDate>Sun, 28 May 2006 17:04:00 -0000</pubDate></item></channel></rss>