<?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: Overloading C++ conditional operator for mixing types</title>
	<atom:link href="http://www.jeffhung.net/blog/articles/jeffhung/744/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jeffhung.net/blog/articles/jeffhung/744/</link>
	<description>(My smile insists of having nose. :-)</description>
	<lastBuildDate>Thu, 03 Nov 2011 00:43:25 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2-alpha</generator>
	<item>
		<title>By: 小鄭</title>
		<link>http://www.jeffhung.net/blog/articles/jeffhung/744/comment-page-1/#comment-68994</link>
		<dc:creator>小鄭</dc:creator>
		<pubDate>Wed, 18 Jul 2007 16:19:11 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeffhung.net/blog/articles/jeffhung/744/#comment-68994</guid>
		<description>上一篇的程式碼好像亂掉了...
http://rafb.net/p/lQh1lJ41.html

因為 function template 沒有提供 partial specialization，所以我想不到好方法把語法作的簡潔。

不過...conditional opeator作成編譯時運算似乎沒什麼好處...:P</description>
		<content:encoded><![CDATA[<p>上一篇的程式碼好像亂掉了...<br />
<a href="http://rafb.net/p/lQh1lJ41.html" rel="nofollow">http://rafb.net/p/lQh1lJ41.html</a></p>
<p>因為 function template 沒有提供 partial specialization，所以我想不到好方法把語法作的簡潔。</p>
<p>不過...conditional opeator作成編譯時運算似乎沒什麼好處...:P</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 小鄭</title>
		<link>http://www.jeffhung.net/blog/articles/jeffhung/744/comment-page-1/#comment-68992</link>
		<dc:creator>小鄭</dc:creator>
		<pubDate>Wed, 18 Jul 2007 16:11:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.jeffhung.net/blog/articles/jeffhung/744/#comment-68992</guid>
		<description>在編譯時期若知道 cond的值，應該可以利用 partial spacialization 的特性來撰寫這個動作，如下：

#include 
#include 

using namespace std;

struct TrueTOrFalseT{};

template
struct dummy_traits{
    typedef Type T;
};

template
struct cond_p{
    typename dummy_traits::T
    operator()( const TrueT &amp;ttp, const FalseT &amp;ft );
};

template
struct cond_p{
    typename dummy_traits::T
    operator()( const TrueT &amp;tt, const FalseT &amp;ft )
    {
        return tt;
    }
};

template
struct cond_p{
    typename dummy_traits::T
    operator()( const TrueT &amp;tt, const FalseT &amp;ft )
    {
        return ft;
    }
};

int main()
{
    cout()( &quot;Allen&quot;, 10 ) ()( &quot;Allen&quot;, 10 ) </description>
		<content:encoded><![CDATA[<p>在編譯時期若知道 cond的值，應該可以利用 partial spacialization 的特性來撰寫這個動作，如下：</p>
<p>#include<br />
#include </p>
<p>using namespace std;</p>
<p>struct TrueTOrFalseT{};</p>
<p>template<br />
struct dummy_traits{<br />
    typedef Type T;<br />
};</p>
<p>template<br />
struct cond_p{<br />
    typename dummy_traits::T<br />
    operator()( const TrueT &amp;ttp, const FalseT &amp;ft );<br />
};</p>
<p>template<br />
struct cond_p{<br />
    typename dummy_traits::T<br />
    operator()( const TrueT &amp;tt, const FalseT &amp;ft )<br />
    {<br />
        return tt;<br />
    }<br />
};</p>
<p>template<br />
struct cond_p{<br />
    typename dummy_traits::T<br />
    operator()( const TrueT &amp;tt, const FalseT &amp;ft )<br />
    {<br />
        return ft;<br />
    }<br />
};</p>
<p>int main()<br />
{<br />
    cout()( "Allen", 10 ) ()( "Allen", 10 )</p>
]]></content:encoded>
	</item>
</channel>
</rss>

