<?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: 當 Constructor 遇上 Virtual Function</title>
	<atom:link href="http://fsfoundry.org/codefreak/2010/03/03/when-ctor-met-virtual-function/feed/" rel="self" type="application/rss+xml" />
	<link>http://fsfoundry.org/codefreak/2010/03/03/when-ctor-met-virtual-function/</link>
	<description>Weblog of a lively geek.</description>
	<lastBuildDate>Wed, 18 Aug 2010 01:20:22 -0700</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jeffhung</title>
		<link>http://fsfoundry.org/codefreak/2010/03/03/when-ctor-met-virtual-function/comment-page-1/#comment-12003</link>
		<dc:creator>jeffhung</dc:creator>
		<pubDate>Thu, 04 Mar 2010 10:35:11 +0000</pubDate>
		<guid isPermaLink="false">http://fsfoundry.org/codefreak/?p=789#comment-12003</guid>
		<description>我習慣用 proxy (handle) class 包裝 class hierarchy 來解這個問題。因為 client code 只能接觸到 proxy (handle)，所以可以隔絕採用 &lt;a href=&quot;http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Virtual_Constructor&quot; title=&quot;Virtual Constructor Idiom&quot; rel=&quot;nofollow&quot;&gt;Virtual Constructor Idiom&lt;/a&gt; 的 (醜陋) implementation class hierarchy。另外，proxy (handle) class 視情況，可以用 &lt;code&gt;shared_ptr&lt;FooImplBase&gt;&lt;/code&gt; 來盛裝 implementation object，以兼顧 thread-safety。

最後，&lt;a href=&quot;http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Base-from-Member&quot; title=&quot;Base-from-Member Idiom&quot; rel=&quot;nofollow&quot;&gt;Base-from-Member Idiom&lt;/a&gt; 是這個問題的另外一種變形，稍加修改設計，亦可適用。</description>
		<content:encoded><![CDATA[<p>我習慣用 proxy (handle) class 包裝 class hierarchy 來解這個問題。因為 client code 只能接觸到 proxy (handle)，所以可以隔絕採用 <a href="http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Virtual_Constructor" title="Virtual Constructor Idiom" rel="nofollow">Virtual Constructor Idiom</a> 的 (醜陋) implementation class hierarchy。另外，proxy (handle) class 視情況，可以用 <code>shared_ptr&lt;FooImplBase&gt;</code> 來盛裝 implementation object，以兼顧 thread-safety。</p>
<p>最後，<a href="http://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Base-from-Member" title="Base-from-Member Idiom" rel="nofollow">Base-from-Member Idiom</a> 是這個問題的另外一種變形，稍加修改設計，亦可適用。</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ricky Lung</title>
		<link>http://fsfoundry.org/codefreak/2010/03/03/when-ctor-met-virtual-function/comment-page-1/#comment-11924</link>
		<dc:creator>Ricky Lung</dc:creator>
		<pubDate>Wed, 03 Mar 2010 02:12:29 +0000</pubDate>
		<guid isPermaLink="false">http://fsfoundry.org/codefreak/?p=789#comment-11924</guid>
		<description>好文章. 期待 &quot;當 Destructor 遇上 Virtual + Multi-thread&quot;</description>
		<content:encoded><![CDATA[<p>好文章. 期待 &#8220;當 Destructor 遇上 Virtual + Multi-thread&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keiko</title>
		<link>http://fsfoundry.org/codefreak/2010/03/03/when-ctor-met-virtual-function/comment-page-1/#comment-11923</link>
		<dc:creator>Keiko</dc:creator>
		<pubDate>Wed, 03 Mar 2010 02:00:37 +0000</pubDate>
		<guid isPermaLink="false">http://fsfoundry.org/codefreak/?p=789#comment-11923</guid>
		<description>可能是這裡：&lt;a href=&quot;http://tlsj.tenlong.com.tw/WebModule/BookSearch/bookSearchViewAction.do?isbn=0321334876&amp;sid=26943&quot; rel=&quot;nofollow&quot;&gt;Effective C++, 3rd&lt;/a&gt;: Item 9: Never call virtual functions during construction or destruction.</description>
		<content:encoded><![CDATA[<p>可能是這裡：<a href="http://tlsj.tenlong.com.tw/WebModule/BookSearch/bookSearchViewAction.do?isbn=0321334876&amp;sid=26943" rel="nofollow">Effective C++, 3rd</a>: Item 9: Never call virtual functions during construction or destruction.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: av</title>
		<link>http://fsfoundry.org/codefreak/2010/03/03/when-ctor-met-virtual-function/comment-page-1/#comment-11895</link>
		<dc:creator>av</dc:creator>
		<pubDate>Tue, 02 Mar 2010 17:37:55 +0000</pubDate>
		<guid isPermaLink="false">http://fsfoundry.org/codefreak/?p=789#comment-11895</guid>
		<description>我忘了之前在哪本書看過的，反正結論說，就是不要在 constructor 使用 virtual function 就對了。</description>
		<content:encoded><![CDATA[<p>我忘了之前在哪本書看過的，反正結論說，就是不要在 constructor 使用 virtual function 就對了。</p>
]]></content:encoded>
	</item>
</channel>
</rss>
