<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: C++ and the bad_alloc exception</title>
	<atom:link href="http://elliottback.com/wp/c-and-the-bad_alloc-exception/feed/" rel="self" type="application/rss+xml" />
	<link>http://elliottback.com/wp/c-and-the-bad_alloc-exception/</link>
	<description>Internet &#38; Technology</description>
	<lastBuildDate>Sun, 22 Nov 2009 02:40:56 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Matthias Hofmann</title>
		<link>http://elliottback.com/wp/c-and-the-bad_alloc-exception/#comment-59516</link>
		<dc:creator>Matthias Hofmann</dc:creator>
		<pubDate>Sun, 28 May 2006 21:04:00 +0000</pubDate>
		<guid isPermaLink="false">http://elliottback.com/wp/?p=904#comment-59516</guid>
		<description>Quote: &quot;Calling [] on a vector apparently returns *(begin() + offset), which when the offset is larger than the size points to invalid memory.&quot;

And that yields undefined behaviour, which means that anything can happen, including a bad_alloc exception being thrown. This is no way to &quot;invoke that behaviour&quot;, and it does not contradict the standard either. It&#039;s simply a blunt mistake that should not happen, just like dereferencing a NULL pointer.</description>
		<content:encoded><![CDATA[<p>Quote: &#8220;Calling [] on a vector apparently returns *(begin() + offset), which when the offset is larger than the size points to invalid memory.&#8221;</p>
<p>And that yields undefined behaviour, which means that anything can happen, including a bad_alloc exception being thrown. This is no way to &#8220;invoke that behaviour&#8221;, and it does not contradict the standard either. It&#8217;s simply a blunt mistake that should not happen, just like dereferencing a NULL pointer.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
