<?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: Code Review &#8211; ActiveMQ-CPP</title>
	<atom:link href="http://fsfoundry.org/codefreak/2009/03/08/code-review-activemq-cpp/feed/" rel="self" type="application/rss+xml" />
	<link>http://fsfoundry.org/codefreak/2009/03/08/code-review-activemq-cpp/</link>
	<description>Weblog of a lively geek.</description>
	<lastBuildDate>Tue, 27 Jul 2010 06:54:46 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: fr3@K</title>
		<link>http://fsfoundry.org/codefreak/2009/03/08/code-review-activemq-cpp/comment-page-1/#comment-4953</link>
		<dc:creator>fr3@K</dc:creator>
		<pubDate>Tue, 10 Mar 2009 01:53:07 +0000</pubDate>
		<guid isPermaLink="false">http://fsfoundry.org/codefreak/2009/03/08/code-review-activemq-cpp/#comment-4953</guid>
		<description>好樣的 Keiko.

你列的第一個 item 算是 platform-dependent behavior, 我沒把它算在文中提到的四個 exception 裏面. 事實上這也反應了 ActiveMQ-CPP 的 debugging code 的不足, 沒有在被呼叫 function 裏面以 &lt;a href=&quot;http://fsfoundry.org/codefreak/2006/04/02/c-cpp-tips-the-marco-assert/&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;assert()&lt;/code&gt; 檢查 parameter 是否符合 expectation&lt;/a&gt;.

另外, 關於 item 3, &lt;a href=&quot;http://www.dinkumware.com/manuals/?manual=compleat&amp;page=utility.html#make_pair&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;make_pair&lt;/code&gt;&lt;/a&gt; 呼叫的  &lt;a href=&quot;http://www.dinkumware.com/manuals/?manual=compleat&amp;page=utility.html#pair&quot; rel=&quot;nofollow&quot;&gt;&lt;code&gt;pair&lt;/code&gt;&lt;/a&gt; ctor 應為:
&lt;ul&gt;&lt;pre&gt;template &lt;class Ty1, class Ty2&gt;
pair&lt;Ty1, Ty2&gt;::pair(const Ty1&amp; val1, const Ty2&amp; val2);&lt;/pre&gt;&lt;/ul&gt;
而非 copy ctor.

Well done. :)</description>
		<content:encoded><![CDATA[<p>好樣的 Keiko.</p>
<p>你列的第一個 item 算是 platform-dependent behavior, 我沒把它算在文中提到的四個 exception 裏面. 事實上這也反應了 ActiveMQ-CPP 的 debugging code 的不足, 沒有在被呼叫 function 裏面以 <a href="http://fsfoundry.org/codefreak/2006/04/02/c-cpp-tips-the-marco-assert/" rel="nofollow"><code>assert()</code> 檢查 parameter 是否符合 expectation</a>.</p>
<p>另外, 關於 item 3, <a href="http://www.dinkumware.com/manuals/?manual=compleat&#038;page=utility.html#make_pair" rel="nofollow"><code>make_pair</code></a> 呼叫的  <a href="http://www.dinkumware.com/manuals/?manual=compleat&#038;page=utility.html#pair" rel="nofollow"><code>pair</code></a> ctor 應為:</p>
<ul>
<pre>template &lt;class Ty1, class Ty2&gt;
pair&lt;Ty1, Ty2&gt;::pair(const Ty1&#038; val1, const Ty2&#038; val2);</pre>
</ul>
<p>而非 copy ctor.</p>
<p>Well done. <img src='http://fsfoundry.org/codefreak/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keiko</title>
		<link>http://fsfoundry.org/codefreak/2009/03/08/code-review-activemq-cpp/comment-page-1/#comment-4950</link>
		<dc:creator>Keiko</dc:creator>
		<pubDate>Mon, 09 Mar 2009 16:13:13 +0000</pubDate>
		<guid isPermaLink="false">http://fsfoundry.org/codefreak/2009/03/08/code-review-activemq-cpp/#comment-4950</guid>
		<description>讓我猜猜至少是哪四個 exceptions：
1. file 是 NULL 時，會讓 std::string ctor 產生 access violation。
2. string::string( const char* ) 可能會產生記憶體配置不足或是類似的記憶體 exception。
3. pair&lt;string,int&gt;的 copy constructor 。
4. stackTrace 利用 allocator 產生一塊記憶體給要 push_back 進來的 object。
5. stackTrace 在 4. 上利用 placement new 呼叫 pair&lt;string,int&gt; 的copy ctor。(placement new 不會產生 exception)

PS. 第一種情況會直接丟出 access violation 讓程式結束，不知道算不算在你提的 exception 裡頭？</description>
		<content:encoded><![CDATA[<p>讓我猜猜至少是哪四個 exceptions：<br />
1. file 是 NULL 時，會讓 std::string ctor 產生 access violation。<br />
2. string::string( const char* ) 可能會產生記憶體配置不足或是類似的記憶體 exception。<br />
3. pair&lt;string,int&gt;的 copy constructor 。<br />
4. stackTrace 利用 allocator 產生一塊記憶體給要 push_back 進來的 object。<br />
5. stackTrace 在 4. 上利用 placement new 呼叫 pair&lt;string,int&gt; 的copy ctor。(placement new 不會產生 exception)</p>
<p>PS. 第一種情況會直接丟出 access violation 讓程式結束，不知道算不算在你提的 exception 裡頭？</p>
]]></content:encoded>
	</item>
</channel>
</rss>
