锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美日韩一区在线播放,亚洲欧美日韩国产中文,亚洲久色影视http://www.shnenglu.com/tommy/archive/2006/04/22/6077.htmlTommy LiangTommy LiangSat, 22 Apr 2006 04:48:00 GMThttp://www.shnenglu.com/tommy/archive/2006/04/22/6077.htmlhttp://www.shnenglu.com/tommy/comments/6077.htmlhttp://www.shnenglu.com/tommy/archive/2006/04/22/6077.html#Feedback0http://www.shnenglu.com/tommy/comments/commentRss/6077.htmlhttp://www.shnenglu.com/tommy/services/trackbacks/6077.html
//聽knapSackSupportTest.cpp聽:聽瀹氫箟鎺у埗鍙板簲鐢ㄧ▼搴忕殑鍏ュ彛鐐廣?br />//

#include聽
"stdafx.h"

typedef聽__int64聽DT;

template
<int聽N>
struct聽factorial{
聽聽聽聽
staticconst聽DT聽value聽=聽N聽*聽factorial<N-1>::value;
}
;

template
<>
struct聽factorial<1>{
聽聽聽聽
staticconst聽DT聽value聽=1;
}
;
static聽DT聽arrFactorial[32];

int聽_tmain(int聽argc,聽_TCHAR*聽argv[])
{
聽聽聽聽arrFactorial[
1]聽=聽factorial<1>().value;
聽聽聽聽arrFactorial[
2]聽=聽factorial<2>().value;
聽聽聽聽arrFactorial[
3]聽=聽factorial<3>().value;
聽聽聽聽arrFactorial[
4]聽=聽factorial<4>().value;
聽聽聽聽arrFactorial[
5]聽=聽factorial<5>().value;
聽聽聽聽arrFactorial[
6]聽=聽factorial<6>().value;
聽聽聽聽arrFactorial[
7]聽=聽factorial<7>().value;
聽聽聽聽arrFactorial[
8]聽=聽factorial<8>().value;
聽聽聽聽arrFactorial[
9]聽=聽factorial<9>().value;
聽聽聽聽arrFactorial[
10]聽=聽factorial<10>().value;
聽聽聽聽arrFactorial[
11]聽=聽factorial<11>().value;
聽聽聽聽arrFactorial[
12]聽=聽factorial<12>().value;
聽聽聽聽arrFactorial[
13]聽=聽factorial<13>().value;
聽聽聽聽arrFactorial[
14]聽=聽factorial<14>().value;
聽聽聽聽arrFactorial[
15]聽=聽factorial<15>().value;
聽聽聽聽arrFactorial[
16]聽=聽factorial<16>().value;
聽聽聽聽arrFactorial[
17]聽=聽factorial<17>().value;
聽聽聽聽
聽聽聽聽
for(int聽i=1;i聽<18;i++)
聽聽聽聽
{
聽聽聽聽聽聽聽聽printf(
"factorial聽of聽%d=%u\n",i,arrFactorial[i]);
聽聽聽聽}
聽聽聽聽

聽聽聽聽
return0;
}




Tommy Liang 2006-04-22 12:48 鍙戣〃璇勮
]]>
璇諱功絎旇銆奀++璁捐鏂版濈淮銆?8) 杈圭晫鏍囪錛歂ullType鍜孍mptyTypehttp://www.shnenglu.com/tommy/archive/2006/02/06/3081.htmlTommy LiangTommy LiangSun, 05 Feb 2006 17:29:00 GMThttp://www.shnenglu.com/tommy/archive/2006/02/06/3081.htmlhttp://www.shnenglu.com/tommy/comments/3081.htmlhttp://www.shnenglu.com/tommy/archive/2006/02/06/3081.html#Feedback0http://www.shnenglu.com/tommy/comments/commentRss/3081.htmlhttp://www.shnenglu.com/tommy/services/trackbacks/3081.html涔﹂噷闈㈣鐨勮繖涓瘝錛?BR>鍨嬪埆璁$畻鐨勮竟鐣屾爣璁?BR>
NullType鍙湁澹版槑娌℃湁瀹氫箟銆?/P>
class NullType;
榪欐槸涓轟簡琛ㄨ揪鈥滄垜涓嶆槸涓護浜烘劅鍏磋叮鐨勫瀷鍒濓紝鍙互浣滀負鈥滄壘涓嶅埌鍨嬪埆鈥濈殑娑堟伅鏍囪銆傜被浼糪0榪欐牱銆?BR>
EmptyType錛屽氨鏄竴涓┖綾?BR>
struct EmptyType {};

榪欐槸鍙緇ф壙鐨勫悎娉曞瀷鍒紝鍙互浣滀負template鐨勭己鐪佸弬鏁板瀷鍒?img src ="http://www.shnenglu.com/tommy/aggbug/3081.html" width = "1" height = "1" />

Tommy Liang 2006-02-06 01:29 鍙戣〃璇勮
]]>
璇諱功絎旇銆奀++璁捐鏂版濈淮銆?7) std::type_info綾葷殑鍖呰綾?/title><link>http://www.shnenglu.com/tommy/archive/2006/02/06/3080.html</link><dc:creator>Tommy Liang</dc:creator><author>Tommy Liang</author><pubDate>Sun, 05 Feb 2006 17:20:00 GMT</pubDate><guid>http://www.shnenglu.com/tommy/archive/2006/02/06/3080.html</guid><wfw:comment>http://www.shnenglu.com/tommy/comments/3080.html</wfw:comment><comments>http://www.shnenglu.com/tommy/archive/2006/02/06/3080.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/tommy/comments/commentRss/3080.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/tommy/services/trackbacks/3080.html</trackback:ping><description><![CDATA[std::type_info綾誨彲浠ュ湪鎵ц鏈熼棿鏌ヨ瀵硅薄鍨嬪埆錛屼絾浣跨敤璧鋒潵姣旇緝楹葷儲銆備負姝ゅ畾涔変簡wrapper<BR><BR>涓嬮潰鐨勪唬鐮佸嚭鑷?Loki搴擄細<BR>鎬誨緱鏉ヨ鏄彁渚涗簡std::type_info鐨勬墍鏈夋垚鍛樺嚱鏁幫紱<BR>鎻愪緵浜唙alue璇箟錛屽嵆public copy鏋勯犲嚱鏁板拰public assignment鎿嶄綔絎︼紱<BR>瀹氫箟浜?operator< 鍜?operator== 絳?BR><BR> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000"> Loki<BR><IMG id=Codehighlighter1_15_1994_Open_Image onclick="this.style.display='none'; Codehighlighter1_15_1994_Open_Text.style.display='none'; Codehighlighter1_15_1994_Closed_Image.style.display='inline'; Codehighlighter1_15_1994_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_15_1994_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_15_1994_Closed_Text.style.display='none'; Codehighlighter1_15_1994_Open_Image.style.display='inline'; Codehighlighter1_15_1994_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_15_1994_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_15_1994_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_17_97_Open_Image onclick="this.style.display='none'; Codehighlighter1_17_97_Open_Text.style.display='none'; Codehighlighter1_17_97_Closed_Image.style.display='inline'; Codehighlighter1_17_97_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_17_97_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_17_97_Closed_Text.style.display='none'; Codehighlighter1_17_97_Open_Image.style.display='inline'; Codehighlighter1_17_97_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_17_97_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter1_17_97_Open_Text><SPAN style="COLOR: #808080">//////////////////////////////////////////////////////////////////////////////</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #808080"></SPAN></SPAN><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> class TypeInfo<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> Purpose: offer a first-class, comparable wrapper over std::type_info</SPAN><SPAN style="COLOR: #008000"><BR><IMG id=Codehighlighter1_188_268_Open_Image onclick="this.style.display='none'; Codehighlighter1_188_268_Open_Text.style.display='none'; Codehighlighter1_188_268_Closed_Image.style.display='inline'; Codehighlighter1_188_268_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_188_268_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_188_268_Closed_Text.style.display='none'; Codehighlighter1_188_268_Open_Image.style.display='inline'; Codehighlighter1_188_268_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_188_268_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</SPAN><SPAN id=Codehighlighter1_188_268_Open_Text><SPAN style="COLOR: #808080">//////////////////////////////////////////////////////////////////////////////</SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #808080"></SPAN></SPAN><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> TypeInfo<BR><IMG id=Codehighlighter1_293_699_Open_Image onclick="this.style.display='none'; Codehighlighter1_293_699_Open_Text.style.display='none'; Codehighlighter1_293_699_Closed_Image.style.display='inline'; Codehighlighter1_293_699_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_293_699_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_293_699_Closed_Text.style.display='none'; Codehighlighter1_293_699_Open_Image.style.display='inline'; Codehighlighter1_293_699_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_293_699_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_293_699_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">:<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> Constructors</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">        TypeInfo(); </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> needed for containers</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">        TypeInfo(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> std::type_info</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">); </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> non-explicit<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> Access for the wrapped std::type_info</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">        </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> std::type_info</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> Get() </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> Compatibility functions</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">        </SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000"> before(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> rhs) </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">char</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000"> name() </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">:<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> std::type_info</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000"> pInfo_;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    <BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> Implementation</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">    <BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    inline TypeInfo::TypeInfo()<BR><IMG id=Codehighlighter1_766_849_Open_Image onclick="this.style.display='none'; Codehighlighter1_766_849_Open_Text.style.display='none'; Codehighlighter1_766_849_Closed_Image.style.display='inline'; Codehighlighter1_766_849_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_766_849_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_766_849_Closed_Text.style.display='none'; Codehighlighter1_766_849_Open_Image.style.display='inline'; Codehighlighter1_766_849_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_766_849_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_766_849_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_786_787_Open_Image onclick="this.style.display='none'; Codehighlighter1_786_787_Open_Text.style.display='none'; Codehighlighter1_786_787_Closed_Image.style.display='inline'; Codehighlighter1_786_787_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_786_787_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_786_787_Closed_Text.style.display='none'; Codehighlighter1_786_787_Open_Image.style.display='inline'; Codehighlighter1_786_787_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> Nil </SPAN><SPAN id=Codehighlighter1_786_787_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_786_787_Open_Text><SPAN style="COLOR: #000000">{}</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        pInfo_ </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">typeid(Nil);<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        assert(pInfo_);<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    <BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    inline TypeInfo::TypeInfo(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> std::type_info</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> ti)<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    : pInfo_(</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000">ti)<BR><IMG id=Codehighlighter1_934_952_Open_Image onclick="this.style.display='none'; Codehighlighter1_934_952_Open_Text.style.display='none'; Codehighlighter1_934_952_Closed_Image.style.display='inline'; Codehighlighter1_934_952_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_934_952_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_934_952_Closed_Text.style.display='none'; Codehighlighter1_934_952_Open_Image.style.display='inline'; Codehighlighter1_934_952_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_934_952_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_934_952_Open_Text><SPAN style="COLOR: #000000">{ assert(pInfo_); }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    <BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    inline </SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000"> TypeInfo::before(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> rhs) </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_1023_1102_Open_Image onclick="this.style.display='none'; Codehighlighter1_1023_1102_Open_Text.style.display='none'; Codehighlighter1_1023_1102_Closed_Image.style.display='inline'; Codehighlighter1_1023_1102_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1023_1102_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1023_1102_Closed_Text.style.display='none'; Codehighlighter1_1023_1102_Open_Image.style.display='inline'; Codehighlighter1_1023_1102_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_1023_1102_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1023_1102_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        assert(pInfo_);<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> pInfo_</SPAN><SPAN style="COLOR: #000000">-></SPAN><SPAN style="COLOR: #000000">before(</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">rhs.pInfo_) </SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    inline </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> std::type_info</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> TypeInfo::Get() </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_1164_1218_Open_Image onclick="this.style.display='none'; Codehighlighter1_1164_1218_Open_Text.style.display='none'; Codehighlighter1_1164_1218_Closed_Image.style.display='inline'; Codehighlighter1_1164_1218_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1164_1218_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1164_1218_Closed_Text.style.display='none'; Codehighlighter1_1164_1218_Open_Image.style.display='inline'; Codehighlighter1_1164_1218_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_1164_1218_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1164_1218_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        assert(pInfo_);<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">pInfo_;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    <BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    inline </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">char</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000"> TypeInfo::name() </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_1275_1336_Open_Image onclick="this.style.display='none'; Codehighlighter1_1275_1336_Open_Text.style.display='none'; Codehighlighter1_1275_1336_Closed_Image.style.display='inline'; Codehighlighter1_1275_1336_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1275_1336_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1275_1336_Closed_Text.style.display='none'; Codehighlighter1_1275_1336_Open_Image.style.display='inline'; Codehighlighter1_1275_1336_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_1275_1336_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1275_1336_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        assert(pInfo_);<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> pInfo_</SPAN><SPAN style="COLOR: #000000">-></SPAN><SPAN style="COLOR: #000000">name();<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"> Comparison operators</SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #000000">    <BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    inline </SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> lhs, </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> rhs)<BR><IMG id=Codehighlighter1_1441_1481_Open_Image onclick="this.style.display='none'; Codehighlighter1_1441_1481_Open_Text.style.display='none'; Codehighlighter1_1441_1481_Closed_Image.style.display='inline'; Codehighlighter1_1441_1481_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1441_1481_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1441_1481_Closed_Text.style.display='none'; Codehighlighter1_1441_1481_Open_Image.style.display='inline'; Codehighlighter1_1441_1481_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_1441_1481_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1441_1481_Open_Text><SPAN style="COLOR: #000000">{ </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> (lhs.Get() </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000"> rhs.Get()) </SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">0</SPAN><SPAN style="COLOR: #000000">; }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    inline </SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> lhs, </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> rhs)<BR><IMG id=Codehighlighter1_1556_1582_Open_Image onclick="this.style.display='none'; Codehighlighter1_1556_1582_Open_Text.style.display='none'; Codehighlighter1_1556_1582_Closed_Image.style.display='inline'; Codehighlighter1_1556_1582_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1556_1582_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1556_1582_Closed_Text.style.display='none'; Codehighlighter1_1556_1582_Open_Image.style.display='inline'; Codehighlighter1_1556_1582_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_1556_1582_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1556_1582_Open_Text><SPAN style="COLOR: #000000">{ </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> lhs.before(rhs); }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    inline </SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000">!=</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> lhs, </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> rhs)<BR><IMG id=Codehighlighter1_1658_1682_Open_Image onclick="this.style.display='none'; Codehighlighter1_1658_1682_Open_Text.style.display='none'; Codehighlighter1_1658_1682_Closed_Image.style.display='inline'; Codehighlighter1_1658_1682_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1658_1682_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1658_1682_Closed_Text.style.display='none'; Codehighlighter1_1658_1682_Open_Image.style.display='inline'; Codehighlighter1_1658_1682_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_1658_1682_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1658_1682_Open_Text><SPAN style="COLOR: #000000">{ </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">(lhs </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000"> rhs); }</SPAN></SPAN><SPAN style="COLOR: #000000">    <BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    <BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    inline </SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> lhs, </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> rhs)<BR><IMG id=Codehighlighter1_1765_1785_Open_Image onclick="this.style.display='none'; Codehighlighter1_1765_1785_Open_Text.style.display='none'; Codehighlighter1_1765_1785_Closed_Image.style.display='inline'; Codehighlighter1_1765_1785_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1765_1785_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1765_1785_Closed_Text.style.display='none'; Codehighlighter1_1765_1785_Open_Image.style.display='inline'; Codehighlighter1_1765_1785_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_1765_1785_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1765_1785_Open_Text><SPAN style="COLOR: #000000">{ </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> rhs </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000"> lhs; }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    <BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    inline </SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000"><=</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> lhs, </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> rhs)<BR><IMG id=Codehighlighter1_1865_1888_Open_Image onclick="this.style.display='none'; Codehighlighter1_1865_1888_Open_Text.style.display='none'; Codehighlighter1_1865_1888_Closed_Image.style.display='inline'; Codehighlighter1_1865_1888_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1865_1888_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1865_1888_Closed_Text.style.display='none'; Codehighlighter1_1865_1888_Open_Image.style.display='inline'; Codehighlighter1_1865_1888_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_1865_1888_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1865_1888_Open_Text><SPAN style="COLOR: #000000">{ </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">(lhs </SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"> rhs); }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>     <BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    inline </SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">operator</SPAN><SPAN style="COLOR: #000000">>=</SPAN><SPAN style="COLOR: #000000">(</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> lhs, </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> TypeInfo</SPAN><SPAN style="COLOR: #000000">&</SPAN><SPAN style="COLOR: #000000"> rhs)<BR><IMG id=Codehighlighter1_1969_1992_Open_Image onclick="this.style.display='none'; Codehighlighter1_1969_1992_Open_Text.style.display='none'; Codehighlighter1_1969_1992_Closed_Image.style.display='inline'; Codehighlighter1_1969_1992_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_1969_1992_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1969_1992_Closed_Text.style.display='none'; Codehighlighter1_1969_1992_Open_Image.style.display='inline'; Codehighlighter1_1969_1992_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_1969_1992_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_1969_1992_Open_Text><SPAN style="COLOR: #000000">{ </SPAN><SPAN style="COLOR: #0000ff">return</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">(lhs </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000"> rhs); }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN></DIV><img src ="http://www.shnenglu.com/tommy/aggbug/3080.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/tommy/" target="_blank">Tommy Liang</a> 2006-02-06 01:20 <a href="http://www.shnenglu.com/tommy/archive/2006/02/06/3080.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璇諱功絎旇銆奀++璁捐鏂版濈淮銆?6) 緙栬瘧鏈熼棿渚︽祴緇ф壙鎬?/title><link>http://www.shnenglu.com/tommy/archive/2006/02/06/3079.html</link><dc:creator>Tommy Liang</dc:creator><author>Tommy Liang</author><pubDate>Sun, 05 Feb 2006 17:11:00 GMT</pubDate><guid>http://www.shnenglu.com/tommy/archive/2006/02/06/3079.html</guid><wfw:comment>http://www.shnenglu.com/tommy/comments/3079.html</wfw:comment><comments>http://www.shnenglu.com/tommy/archive/2006/02/06/3079.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/tommy/comments/commentRss/3079.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/tommy/services/trackbacks/3079.html</trackback:ping><description><![CDATA[鍦ㄧ紪璇戞椂鍒伙紝鍦–onversion綾諱腑浜х敓涓や釜甯告暟錛堢紪璇戝櫒甯繖璁$畻錛?BR><BR> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">template </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> T,</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> U</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> Conversion<BR><IMG id=Codehighlighter1_44_154_Open_Image onclick="this.style.display='none'; Codehighlighter1_44_154_Open_Text.style.display='none'; Codehighlighter1_44_154_Closed_Image.style.display='inline'; Codehighlighter1_44_154_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_44_154_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_44_154_Closed_Text.style.display='none'; Codehighlighter1_44_154_Open_Image.style.display='inline'; Codehighlighter1_44_154_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_44_154_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_44_154_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #008000">//</SPAN><SPAN style="COLOR: #008000"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN style="COLOR: #008000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">:<BR><IMG id=Codehighlighter1_67_116_Open_Image onclick="this.style.display='none'; Codehighlighter1_67_116_Open_Text.style.display='none'; Codehighlighter1_67_116_Closed_Image.style.display='inline'; Codehighlighter1_67_116_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_67_116_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_67_116_Closed_Text.style.display='none'; Codehighlighter1_67_116_Open_Image.style.display='inline'; Codehighlighter1_67_116_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">enum</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN id=Codehighlighter1_67_116_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_67_116_Open_Text><SPAN style="COLOR: #000000">{ exists2Way </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> exists </SPAN><SPAN style="COLOR: #000000">&&</SPAN><SPAN style="COLOR: #000000"> Conversion</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">U,T</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000">::exists }</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR><IMG id=Codehighlighter1_132_151_Open_Image onclick="this.style.display='none'; Codehighlighter1_132_151_Open_Text.style.display='none'; Codehighlighter1_132_151_Closed_Image.style.display='inline'; Codehighlighter1_132_151_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_132_151_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_132_151_Closed_Text.style.display='none'; Codehighlighter1_132_151_Open_Image.style.display='inline'; Codehighlighter1_132_151_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>        </SPAN><SPAN style="COLOR: #0000ff">enum</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN id=Codehighlighter1_132_151_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_132_151_Open_Text><SPAN style="COLOR: #000000">{ sameType </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000"> }</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000">;</SPAN></DIV>涓涓槸 exists2Way錛岃〃紺烘槸鍚﹀彲浠ヤ袱涓被鍨嬩簰鐩歌漿鎹紝<BR>sameType 琛ㄧず T鍜孶鏄惁鍚屼竴涓被鍨嬨?BR>涓嶈繃錛岃櫧鐒朵功閲岃繖涔堣錛屾垜鎬庝箞閮芥悶涓嶆噦涓轟粈涔堣繖鏍峰彲浠ワ紝嫻嬭瘯涔熸槸涓嶅鐨勶紝闅鵑亾榪欎釜sameType鐨勫啓娉曡繕鏈夊埆鐨勫ゥ濡欙紵<BR>涓嶈繃涓嬮潰榪欎釜鍋忕壒鐨勫啓娉曞掓槸姣旇緝瀹規槗鐞嗚В錛?BR> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">template </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> T</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> Conversion</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">T,T</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR><IMG id=Codehighlighter1_41_101_Open_Image onclick="this.style.display='none'; Codehighlighter1_41_101_Open_Text.style.display='none'; Codehighlighter1_41_101_Closed_Image.style.display='inline'; Codehighlighter1_41_101_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_41_101_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_41_101_Closed_Text.style.display='none'; Codehighlighter1_41_101_Open_Image.style.display='inline'; Codehighlighter1_41_101_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_41_101_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_41_101_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">:<BR><IMG id=Codehighlighter1_57_98_Open_Image onclick="this.style.display='none'; Codehighlighter1_57_98_Open_Text.style.display='none'; Codehighlighter1_57_98_Closed_Image.style.display='inline'; Codehighlighter1_57_98_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_57_98_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_57_98_Closed_Text.style.display='none'; Codehighlighter1_57_98_Open_Image.style.display='inline'; Codehighlighter1_57_98_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">enum</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN id=Codehighlighter1_57_98_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_57_98_Open_Text><SPAN style="COLOR: #000000">{ exists </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">,exists2Way </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000">,sameType </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">1</SPAN><SPAN style="COLOR: #000000"> }</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000">;</SPAN></DIV>榪欎釜嫻嬭瘯鏄疧K鐨勩?BR><BR>鏈変簡榪欏嚑涓父鏁幫紝瑕佸喅瀹氫袱涓猚lass涔嬮棿鏄惁瀛樺湪緇ф壙鍏崇郴灝辨瘮杈冨鏄撲簡錛?BR> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">#define</SPAN><SPAN style="COLOR: #000000"> SUPERSUBCLASS(T,U) \</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top>(Conversion</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> U</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> T</SPAN><SPAN style="COLOR: #000000">*></SPAN><SPAN style="COLOR: #000000">::exists </SPAN><SPAN style="COLOR: #000000">&&</SPAN><SPAN style="COLOR: #000000"> \<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">Conversion</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> T</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000">*></SPAN><SPAN style="COLOR: #000000">::sameType)</SPAN></DIV>濡傛灉U鏄痯ublic緇ф壙鑷猅錛屾垨鑰匱鍜孶鏄悓涓涓被錛岄偅涔圫UPERSUBCLASS(T,U)浼犲洖true錛岃繖閲屾槸鎶婃煇涓猚lass瑙嗕負鑷繁鐨勮秴綾伙紝鏇翠弗璋ㄧ殑鍋氭硶鏄細<BR> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #0000ff">#define</SPAN><SPAN style="COLOR: #000000"> SUPERSUBCLASS_STRICT(T,U) \</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top>(SUPERSUBCLASS(T,U) </SPAN><SPAN style="COLOR: #000000">&&</SPAN><SPAN style="COLOR: #000000"> \<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #000000">!</SPAN><SPAN style="COLOR: #000000">Conversion</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> T, </SPAN><SPAN style="COLOR: #0000ff">const</SPAN><SPAN style="COLOR: #000000"> U</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000">::sameType)</SPAN></DIV>鍗蟲帓闄涓嶶鏄悓涓涓被鍨嬬殑鎯呭喌銆?BR><BR>鍙﹀錛屽姞涓?const 鏄負浜?闃叉鍥犱負 const 鑰屽鑷磋漿鍨嬪け璐ワ紝瀵逛簬宸茬粡鏄痗onst鐨勪笢瑗垮啀const涓嬈$殑璇濆悗闈竴嬈$殑const浼氬拷鐣ユ帀銆?BR><BR>鍐嶏紝榪欎釜瀹忕殑鍚嶅瓧寰堟竻鏅幫紝灝辨槸 瓚呯被--瀛愮被錛?鍓嶉潰閭d釜T鏄秴綾伙紝U鏄瓙綾伙紝榪欎釜鍛藉悕姣?INHERITS瑕佸ソ銆?img src ="http://www.shnenglu.com/tommy/aggbug/3079.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/tommy/" target="_blank">Tommy Liang</a> 2006-02-06 01:11 <a href="http://www.shnenglu.com/tommy/archive/2006/02/06/3079.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璇諱功絎旇銆奀++璁捐鏂版濈淮銆?5) 緙栬瘧鏈熼棿渚︽祴鍙漿鎹㈡?/title><link>http://www.shnenglu.com/tommy/archive/2006/02/05/3059.html</link><dc:creator>Tommy Liang</dc:creator><author>Tommy Liang</author><pubDate>Sat, 04 Feb 2006 21:34:00 GMT</pubDate><guid>http://www.shnenglu.com/tommy/archive/2006/02/05/3059.html</guid><wfw:comment>http://www.shnenglu.com/tommy/comments/3059.html</wfw:comment><comments>http://www.shnenglu.com/tommy/archive/2006/02/05/3059.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/tommy/comments/commentRss/3059.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/tommy/services/trackbacks/3059.html</trackback:ping><description><![CDATA[灝辨槸榪欐牱涓涓被錛?BR> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">template </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> T,</SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> U</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> Conversion<BR><IMG id=Codehighlighter1_44_230_Open_Image onclick="this.style.display='none'; Codehighlighter1_44_230_Open_Text.style.display='none'; Codehighlighter1_44_230_Closed_Image.style.display='inline'; Codehighlighter1_44_230_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_44_230_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_44_230_Closed_Text.style.display='none'; Codehighlighter1_44_230_Open_Image.style.display='inline'; Codehighlighter1_44_230_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_44_230_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_44_230_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    typedef </SPAN><SPAN style="COLOR: #0000ff">char</SPAN><SPAN style="COLOR: #000000"> Small;<BR><IMG id=Codehighlighter1_78_95_Open_Image onclick="this.style.display='none'; Codehighlighter1_78_95_Open_Text.style.display='none'; Codehighlighter1_78_95_Closed_Image.style.display='inline'; Codehighlighter1_78_95_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_78_95_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_78_95_Closed_Text.style.display='none'; Codehighlighter1_78_95_Open_Image.style.display='inline'; Codehighlighter1_78_95_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> Big </SPAN><SPAN id=Codehighlighter1_78_95_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_78_95_Open_Text><SPAN style="COLOR: #000000">{ </SPAN><SPAN style="COLOR: #0000ff">char</SPAN><SPAN style="COLOR: #000000"> dummy[</SPAN><SPAN style="COLOR: #000000">2</SPAN><SPAN style="COLOR: #000000">]; }</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> Small Test(U);<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> Big Test(<IMG src="http://www.shnenglu.com/images/dot.gif">);<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">static</SPAN><SPAN style="COLOR: #000000"> T MakeT();<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">:<BR><IMG id=Codehighlighter1_177_227_Open_Image onclick="this.style.display='none'; Codehighlighter1_177_227_Open_Text.style.display='none'; Codehighlighter1_177_227_Closed_Image.style.display='inline'; Codehighlighter1_177_227_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_177_227_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_177_227_Closed_Text.style.display='none'; Codehighlighter1_177_227_Open_Image.style.display='inline'; Codehighlighter1_177_227_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">enum</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN id=Codehighlighter1_177_227_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_177_227_Open_Text><SPAN style="COLOR: #000000">{ exists </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">sizeof</SPAN><SPAN style="COLOR: #000000">(Test(MakeT())) </SPAN><SPAN style="COLOR: #000000">==</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">sizeof</SPAN><SPAN style="COLOR: #000000">(Small) }</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000">;</SPAN></DIV><BR>鍏充簬鍑芥暟 Small Test(U) 鍜?Big Test(...) 錛屼功閲岄潰璇達細<BR> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">銆傘傘傞渶瑕佷袱涓噸杞藉嚱鏁幫紝鍏朵竴濡傚厛鍓嶆墍璇達紝鎺ュ彈涓涓猆瀵硅薄騫朵紶鍥炰竴涓猄mall瀵硅薄錛?BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top>Small Test(U);<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top>浣嗘帴涓嬫潵錛屾垜璇ュ浣曞啓鍑轟竴涓彲鎺ュ彈浠諱綍鍏朵粬縐嶅璞$殑鍑芥暟鍛紵銆傘傘傘?/SPAN></DIV><BR>鎴戣寰楄繖涓湴鏂圭炕璇戝緱鏈夌偣闂錛屾槸涓嶆槸搴旇璇達細鈥溿傘傛垜璇ュ浣曞啓鍑轟竴涓彲鎺ュ彈浠諱綍<STRONG><FONT color=#ff0000>鍙﹀涓縐嶇被鍨嬶紙鍗?T錛夌殑</FONT></STRONG>瀵硅薄鐨勫嚱鏁板憿銆傘傗濓紝鍥犱負榪欓噷灝辨槸 T鍜孶鍢涳紝 娌℃湁浠涔堚滃叾浠栫鈥濓紝榪欐牱緲昏瘧瀹規槗璁╂垜榪鋒儜涓嶈В浜嗕竴浼氬効銆?BR><BR><STRONG><FONT color=#ff1493>濡傛灉鎺ュ彈 U鐨勯偅涓嚱鏁拌璋冪敤錛屽垯T鍙互琚漿鎹負 U錛屽惁鍒欐棤娉曡漿鎹紝榪欎釜鏄濊礬鐨勬牴鏈?/FONT></STRONG><BR><BR>涓轟粈涔堣鍋氫竴涓?MakeT榪欐牱鐨勫嚱鏁拌屼笉鐩存帴浣跨敤T鍛紵 榪欐槸涓轟簡婊¤凍褰?T 鍙湁縐佹湁鏋勯犲嚱鏁扮殑鎯呭喌錛屽浜庣紪璇戝櫒鏉ヨ錛宻izeof 鏄湪緙栬瘧鏈熷畬鎴愯瘎浼扮殑錛屾墍浠ワ紝MakeT 閲岄潰鍒板簳鍋氫簡浠涔堝茍涓嶉噸瑕侊紝閲嶈鐨勬槸浠栬繑鍥炵殑綾誨瀷錛屾槸 T錛屾墍浠ワ紝浣滆呭緢鍏村鍦拌錛岃繖鏄竴涓?StrawMan function錛屽嵆鈥滅ɑ鑽変漢鍑芥暟鈥濓紝鍝堝搱錛屽彧鏄竴涓牱瀛愯屽凡錛屼絾鏄繖宸茬粡瓚沖浜嗭紝閭d袱涓噸杞界殑Test鏂規硶涔熸槸涓鏍鳳紝榪欓噷鎴戜滑涓嶅叧蹇冧粬鐨勫嚱鏁頒綋銆傚己鍟婏紝鐖芥姝紝蹇劅鐨勬簮娉夊晩<BR><BR>嫻嬭瘯浠g爜濡備笅錛?BR> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">    </SPAN><SPAN style="COLOR: #0000ff">using</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">namespace</SPAN><SPAN style="COLOR: #000000"> std;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top>    cout </SPAN><SPAN style="COLOR: #000000"><<</SPAN><SPAN style="COLOR: #000000"> Conversion</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">double</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000">::exists </SPAN><SPAN style="COLOR: #000000"><<</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top>        </SPAN><SPAN style="COLOR: #000000"><<</SPAN><SPAN style="COLOR: #000000"> Conversion</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">char</SPAN><SPAN style="COLOR: #000000">, </SPAN><SPAN style="COLOR: #0000ff">char</SPAN><SPAN style="COLOR: #000000">*></SPAN><SPAN style="COLOR: #000000">::exists </SPAN><SPAN style="COLOR: #000000"><<</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top>        </SPAN><SPAN style="COLOR: #000000"><<</SPAN><SPAN style="COLOR: #000000"> Conversion</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">size_t, vector</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000">::exists </SPAN><SPAN style="COLOR: #000000"><<</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #000000">'</SPAN><SPAN style="COLOR: #000000">;</SPAN></DIV>杈撳嚭錛?1 0 0<BR>double鍙互杞崲涓?int<BR>char 涓嶈兘杞崲涓?char* <BR>vector<int> 鏄竴涓鍣ㄧ殑鏋勯犲嚱鏁幫紝size_t 涓嶈兘杞崲錛屽洜涓鴻繖涓瀯閫犲嚱鏁版槸 explicit鐨?榪欎釜鍦版柟榪樻槸鏈夌偣榪風硦錛岃繕寰楃爺絀朵竴涓嬨?img src ="http://www.shnenglu.com/tommy/aggbug/3059.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/tommy/" target="_blank">Tommy Liang</a> 2006-02-05 05:34 <a href="http://www.shnenglu.com/tommy/archive/2006/02/05/3059.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璇諱功絎旇銆奀++璁捐鏂版濈淮銆?4) Type Selectionhttp://www.shnenglu.com/tommy/archive/2006/02/05/3057.htmlTommy LiangTommy LiangSat, 04 Feb 2006 20:53:00 GMThttp://www.shnenglu.com/tommy/archive/2006/02/05/3057.htmlhttp://www.shnenglu.com/tommy/comments/3057.htmlhttp://www.shnenglu.com/tommy/archive/2006/02/05/3057.html#Feedback0http://www.shnenglu.com/tommy/comments/commentRss/3057.htmlhttp://www.shnenglu.com/tommy/services/trackbacks/3057.html
鏈夋椂鍊欙紝鑼冨瀷紼嬪簭闇瑕佹牴鎹竴涓猙oolean鍙橀噺鏉ラ夋嫨鏌愪釜鍨嬪埆鎴栧彟涓涓瀷鍒?BR>涓嬮潰瀹氫箟鐨勭粨鏋勬彁鍑轟簡瑙e喅鏂規錛?BR>
template <bool flag,typename T,typename U>
struct Select
{
    typedef T Result;
}
;
//鍋忕壒鍖?/SPAN>
template <typename T,typename U>
struct Select<false,T,U>
{
    typedef U Result;
}
;
涔熷氨鏄錛屽鏋渇lag鏄痶rue錛屽垯緙栬瘧鍣ㄤ嬌鐢ㄧ涓浠藉畾涔夛紝鍗砇esult琚畾涔変負T錛?BR>濡傛灉鏄痜alse,鍒欏亸鐗瑰寲鏈哄埗璧蜂綔鐢紝Result琚畾涔変負 U

鍋忕壒鍖栫湡寮猴紝鍏ㄥ湪涔庢兂璞″姏浜?img src ="http://www.shnenglu.com/tommy/aggbug/3057.html" width = "1" height = "1" />

Tommy Liang 2006-02-05 04:53 鍙戣〃璇勮
]]>
璇諱功絎旇銆奀++璁捐鏂版濈淮銆?3) Type2Type鐨勬剰涔?http://www.shnenglu.com/tommy/archive/2006/02/05/3056.htmlTommy LiangTommy LiangSat, 04 Feb 2006 20:40:00 GMThttp://www.shnenglu.com/tommy/archive/2006/02/05/3056.htmlhttp://www.shnenglu.com/tommy/comments/3056.htmlhttp://www.shnenglu.com/tommy/archive/2006/02/05/3056.html#Feedback0http://www.shnenglu.com/tommy/comments/commentRss/3056.htmlhttp://www.shnenglu.com/tommy/services/trackbacks/3056.html灝辨槸榪欐牱涓涓粨鏋勶細

template <typename T>
struct Type2Type
{
    typedef T OriginalType;    
}
;

鍋囧畾鏈変釜鐗囨柇濡備笅錛屽垱寤轟竴涓猅*
template <class T,class U>
T
* Create(const U& arg)
{
    
return new T(arg);
}

濡傛灉瀵逛簬鏌愪釜綾誨鈥淲idget鈥濓紝鍏禼tor瑕佹湁涓や釜鍙傛暟錛屾瘮濡傜浜屼釜鍙傛暟蹇呴』鏄?1錛堝浜庢棫鐨勪唬鐮佹潵璇達紝璋佺煡閬撳憿:)錛夛紝浣嗗張涓嶆兂鍙﹀鍒涘緩涓涓淐reateWidget鈥濇柟娉曪紝閭d箞鎬庝箞鍔炲憿錛屽嚱鏁版槸涓嶈兘鍋忕壒鍖栫殑錛屽嵆濡備笅浠g爜錛?BR>
//閿欒鐨勪唬鐮?BR>template <class U>
Widget
* Create<Widget,U>(const U& arg)
{
    
return new Widget(arg,-1);
}
鍦?VC7涓嬩細鎶ュ憡錛氶潪娉曚嬌鐢ㄦ樉寮忔ā鏉垮弬鏁?BR>
鍙兘浣跨敤鍑芥暟閲嶈澆錛屾瘮濡傦細
template <class T,class U>
T
* Create(const U&arg,T /*铏氭嫙*/)
{
   
return new T(arg);
}


template 
<class U>
Widget 
* Create(const U& arg, Widget /*铏氭嫙*/)
{
    
return new Widget(arg,-1);
}

  榪欐牱鏄彲浠ヨВ鍐抽棶棰橈紝浣嗘渶澶х殑姣涚梾鍦ㄤ簬榪愯鏃舵瀯閫犱簡 鏈浣跨敤鐨勫璞¤繖涓紑閿錛堣櫄鎷熺殑Widget鍙傛暟錛夈傝繖鏃?Type2Type 榪欎釜鍜氬挌鍑哄満浜嗭紝鎸夌収涔︾殑璇存硶錛岃繖鏄滀竴涓瀷鍒唬琛ㄧ墿銆佷竴涓彲浠ヨ浣犱紶緇欓噸杞藉嚱鏁扮殑杞婚噺綰D鈥濓紝濡備笅錛?BR>

template <class T,class U>
T
* Create(const U& arg,Type2Type<T>)
{
    
return new T(arg);
}


template 
<class U>
Widget 
* Create(const U& arg,Type2Type<Widget>)
{
    
return new Widget(arg,-1);
}


璋冪敤鏂癸細
String 
*pStr = Create("hello",Type2Type<String>());
Widget 
*pW = Create(100,Type2Type<Widget>());

 

鍏抽敭鏄紝榪欎釜涓滆タ涔熸槸緇欑紪璇戝櫒鐪嬬殑錛屽



Tommy Liang 2006-02-05 04:40 鍙戣〃璇勮
]]>
璇諱功絎旇銆奀++璁捐鏂版濈淮銆?2) Int2Type鐨勬剰涔?/title><link>http://www.shnenglu.com/tommy/archive/2006/01/24/2996.html</link><dc:creator>Tommy Liang</dc:creator><author>Tommy Liang</author><pubDate>Mon, 23 Jan 2006 18:20:00 GMT</pubDate><guid>http://www.shnenglu.com/tommy/archive/2006/01/24/2996.html</guid><wfw:comment>http://www.shnenglu.com/tommy/comments/2996.html</wfw:comment><comments>http://www.shnenglu.com/tommy/archive/2006/01/24/2996.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/tommy/comments/commentRss/2996.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/tommy/services/trackbacks/2996.html</trackback:ping><description><![CDATA[<P>灝辨槸榪欎箞涓涓ā鏉跨粨鏋勶紝鎵鏈夌殑浠峰煎湪浜庣紪璇戞椂鍒繪牴鎹父鏁拌皟鐢ㄤ笉鍚屽嚱鏁版垨鑰呯紪璇戞湡瀹炴柦緙栬瘧鍒嗘敮鐨勫垎媧俱?/P> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">template </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">int</SPAN><SPAN style="COLOR: #000000"> v</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">struct</SPAN><SPAN style="COLOR: #000000"> Int2Type<BR><IMG id=Codehighlighter1_33_56_Open_Image onclick="this.style.display='none'; Codehighlighter1_33_56_Open_Text.style.display='none'; Codehighlighter1_33_56_Closed_Image.style.display='inline'; Codehighlighter1_33_56_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_33_56_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_33_56_Closed_Text.style.display='none'; Codehighlighter1_33_56_Open_Image.style.display='inline'; Codehighlighter1_33_56_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_33_56_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_33_56_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG id=Codehighlighter1_41_53_Open_Image onclick="this.style.display='none'; Codehighlighter1_41_53_Open_Text.style.display='none'; Codehighlighter1_41_53_Closed_Image.style.display='inline'; Codehighlighter1_41_53_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_41_53_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_41_53_Closed_Text.style.display='none'; Codehighlighter1_41_53_Open_Image.style.display='inline'; Codehighlighter1_41_53_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">enum</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN id=Codehighlighter1_41_53_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_41_53_Open_Text><SPAN style="COLOR: #000000">{ value </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> v }</SPAN></SPAN><SPAN style="COLOR: #000000">;<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000">;</SPAN></DIV><BR>濡備笅錛?BR> <DIV style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">template </SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">typename T, </SPAN><SPAN style="COLOR: #0000ff">bool</SPAN><SPAN style="COLOR: #000000"> isPolimorphic</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">class</SPAN><SPAN style="COLOR: #000000"> NiftyContainer<BR><IMG id=Codehighlighter1_63_325_Open_Image onclick="this.style.display='none'; Codehighlighter1_63_325_Open_Text.style.display='none'; Codehighlighter1_63_325_Closed_Image.style.display='inline'; Codehighlighter1_63_325_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align=top><IMG id=Codehighlighter1_63_325_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_63_325_Closed_Text.style.display='none'; Codehighlighter1_63_325_Open_Image.style.display='inline'; Codehighlighter1_63_325_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align=top></SPAN><SPAN id=Codehighlighter1_63_325_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_63_325_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">private</SPAN><SPAN style="COLOR: #000000">:<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000"> DoSomething( T</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000"> pObj, Int2Type</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">true</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000">)<BR><IMG id=Codehighlighter1_119_152_Open_Image onclick="this.style.display='none'; Codehighlighter1_119_152_Open_Text.style.display='none'; Codehighlighter1_119_152_Closed_Image.style.display='inline'; Codehighlighter1_119_152_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_119_152_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_119_152_Closed_Text.style.display='none'; Codehighlighter1_119_152_Open_Image.style.display='inline'; Codehighlighter1_119_152_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_119_152_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_119_152_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        T</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000"> pNewObj </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> pObj</SPAN><SPAN style="COLOR: #000000">-></SPAN><SPAN style="COLOR: #000000">Clone();<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000"> DoSomething( T</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000"> pObj, Int2Type</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #0000ff">false</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000">)<BR><IMG id=Codehighlighter1_200_233_Open_Image onclick="this.style.display='none'; Codehighlighter1_200_233_Open_Text.style.display='none'; Codehighlighter1_200_233_Closed_Image.style.display='inline'; Codehighlighter1_200_233_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_200_233_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_200_233_Closed_Text.style.display='none'; Codehighlighter1_200_233_Open_Image.style.display='inline'; Codehighlighter1_200_233_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_200_233_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_200_233_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        T </SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000"> pNewObj </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">new</SPAN><SPAN style="COLOR: #000000"> T(</SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000">pObj);<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top></SPAN><SPAN style="COLOR: #0000ff">public</SPAN><SPAN style="COLOR: #000000">:<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>    </SPAN><SPAN style="COLOR: #0000ff">void</SPAN><SPAN style="COLOR: #000000"> DoSomething(T </SPAN><SPAN style="COLOR: #000000">*</SPAN><SPAN style="COLOR: #000000"> pObj)<BR><IMG id=Codehighlighter1_272_323_Open_Image onclick="this.style.display='none'; Codehighlighter1_272_323_Open_Text.style.display='none'; Codehighlighter1_272_323_Closed_Image.style.display='inline'; Codehighlighter1_272_323_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align=top><IMG id=Codehighlighter1_272_323_Closed_Image style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_272_323_Closed_Text.style.display='none'; Codehighlighter1_272_323_Open_Image.style.display='inline'; Codehighlighter1_272_323_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align=top>    </SPAN><SPAN id=Codehighlighter1_272_323_Closed_Text style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"><IMG src="http://www.shnenglu.com/images/dot.gif"></SPAN><SPAN id=Codehighlighter1_272_323_Open_Text><SPAN style="COLOR: #000000">{<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align=top>        DoSomething(pObj, Int2Type</SPAN><SPAN style="COLOR: #000000"><</SPAN><SPAN style="COLOR: #000000">isPolimorphic</SPAN><SPAN style="COLOR: #000000">></SPAN><SPAN style="COLOR: #000000">());<BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align=top>    }</SPAN></SPAN><SPAN style="COLOR: #000000"><BR><IMG src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align=top>}</SPAN></SPAN><SPAN style="COLOR: #000000">;</SPAN></DIV><BR>濡傛灉娌℃湁榪欎釜 Int2Type錛屾槸涓嶅彲鑳藉疄鐜頒袱涓滈噸杞解濆嚱鏁?DoSomething( .. Int2Type<true>)鍜?DoSomething(...Int2Type<false>)鐨勶紝NiftyContainer鐨勫弬鏁?isPolimorphic鍙兘鍙杢rue鎴栬協alse錛屽疄闄呬笂緙栬瘧鍑烘潵鐨勮涔堟槸鍓嶄竴涓嚱鏁幫紝瑕佷箞鏄悗涓涓嚱鏁般?BR>濡傛灉娌℃湁榪欎釜Int2Type錛屾渶瀹規槗鎯沖埌鐨勫氨鏄儚涓嬮潰榪欐牱鍋氾細<BR><BR>if (isPolimorphic)<BR>{<BR>      T * pNewObj = pSomeObj->Clone();<BR>}<BR>else<BR>{<BR>       T * pNewObj = new T (*pSomeObj);<BR>}<BR><BR>濡傛灉澶氭佺畻娉曚嬌鐢?pObj->Clone(),閭d箞瀵逛簬浠諱綍涓涓湭鏇懼畾涔?Clone鍑芥暟錛堝嵆isPolimorphic==false錛夌殑綾繪潵璇達紝榪欓噷鐨勫墠涓涓垎鏀槸緙栬瘧澶辮觸鐨勩傚弽涔嬶紝濡傛灉 isPolimorphic == true錛屾槸涓嶆槸鍚庨潰閭d釜鍒嗘敮灝變繚璇佹病闂錛屼竴瀹氳兘閫氳繃鍛紵涓嶆槸鐨勶紝濡傛灉鏈変竴涓被璁捐鎴愪負鏈?Clone鍑芥暟錛屼絾鏄瀯閫犲嚱鏁版槸縐佹湁鐨勶紝灝變笉琛屽挴銆?BR><BR>鎵浠ワ紝 Int2Type鏄窡緙栬瘧鍣ㄨ錛氬樋錛屼笉瑕佸幓綆¢偅涓垜涓嶅叧蹇冪殑鍒嗘敮銆?<BR><BR>濡欏晩錛?img src ="http://www.shnenglu.com/tommy/aggbug/2996.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/tommy/" target="_blank">Tommy Liang</a> 2006-01-24 02:20 <a href="http://www.shnenglu.com/tommy/archive/2006/01/24/2996.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璇諱功絎旇銆奀++璁捐鏂版濈淮銆?1) Template Template 鍙傛暟http://www.shnenglu.com/tommy/archive/2006/01/21/2951.htmlTommy LiangTommy LiangFri, 20 Jan 2006 20:39:00 GMThttp://www.shnenglu.com/tommy/archive/2006/01/21/2951.htmlhttp://www.shnenglu.com/tommy/comments/2951.htmlhttp://www.shnenglu.com/tommy/archive/2006/01/21/2951.html#Feedback2http://www.shnenglu.com/tommy/comments/commentRss/2951.htmlhttp://www.shnenglu.com/tommy/services/trackbacks/2951.html

template <class T>
struct OpNewCreator
{
    
static T* Create()
    
{
        
return new T;
    }

}
;
template 
<class T>
struct MallocCreator
{
    
static T* Create()
    
{
        
void * buf = std::malloc(sizeof(T));
        
if (! buf ) return 0;
        
return new(buf) T;
    }

}
;
template 
<class T>
struct PrototypeCreator
{
    PrototypeCreator(T
* pObj = 0) : pPrototype_(pObj)
    
{}
    T 
* Create()
    
{
        
return pPrototype_ ? pPrototype_->Clone() : 0;
    }

    T
* GetPrototype() return pPrototype_; }
    
void SetPrototype(T * pObj) { pPrototype_ = pObj; }
private:
    T
* pPrototype_;
}
;


class Widget
{
}
;


template 
<template <class Created> class CreationPolicy>
class WidgetManager : public CreationPolicy<Widget>
{
    
//
}
;



int _tmain(int argc, _TCHAR* argv[])
{
    typedef WidgetManager
< OpNewCreator >  myWidgetMgr;

    
return 0;
}


Tommy Liang 2006-01-21 04:39 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            欧美大成色www永久网站婷| 亚洲一区二区网站| 欧美精品二区| 狠狠综合久久| 久久久精品日韩欧美| 日韩亚洲在线| 美国成人毛片| 国产精品亚洲成人| 影音国产精品| 亚洲国产一区视频| 欧美精品自拍| 美女免费视频一区| 欧美中文在线视频| 欧美日韩大片| 欧美一区三区二区在线观看| 亚洲欧美一区二区三区在线| 久久精品国产清高在天天线 | 久久激情一区| 亚洲人成绝费网站色www| 91久久精品国产91性色tv| 欧美日韩视频| 欧美一区二区福利在线| 性欧美超级视频| 亚洲一区3d动漫同人无遮挡| 久久综合中文| 国产精品九九| 国产日韩欧美综合| 国产精品久久九九| 蜜桃av一区二区三区| 亚洲大片av| 国产亚洲欧美一区在线观看| 亚洲国产一区二区a毛片| 欧美午夜无遮挡| 国产精品视频免费观看www| 久久精品99国产精品| 中文久久乱码一区二区| 亚洲一区二区日本| 亚洲精品一二区| 在线观看欧美精品| 一区二区三区四区精品| 一区国产精品| 99成人在线| 亚洲精品视频一区| 久久综合色影院| 亚洲国产日韩欧美在线动漫| 99国产精品| av成人国产| 欧美精品在线一区| 亚洲国产电影| 亚洲福利国产| 欧美日韩国产欧美日美国产精品| 久久精品午夜| 国产精品日本精品| 亚洲精选中文字幕| 一区二区三区日韩精品| 毛片av中文字幕一区二区| 美国成人毛片| 亚洲黄网站在线观看| 欧美91大片| 国产精品嫩草久久久久| 久久综合国产精品台湾中文娱乐网| 亚洲区一区二区三区| 欧美女人交a| 欧美一区二区三区视频免费播放| 亚洲国产另类 国产精品国产免费| 欧美日韩一区高清| 久久一区二区三区av| 欧美xxx成人| 国产精品呻吟| 欧美成人69av| 亚洲精一区二区三区| 性18欧美另类| 久久一区二区三区国产精品| 欧美与黑人午夜性猛交久久久| 欧美专区在线观看| 狠狠v欧美v日韩v亚洲ⅴ| 久久视频在线视频| 国产一区二区三区日韩| 久久综合久久综合久久综合| 欧美日韩一区成人| 午夜精品影院| 国产在线观看精品一区二区三区| 亚洲一区二区三区视频播放| 欧美资源在线观看| 一区在线播放| 欧美国产日韩xxxxx| 亚洲欧美中日韩| 久久精品成人一区二区三区| 亚洲欧美另类中文字幕| 黄色免费成人| 欧美三级在线| 国产亚洲精品一区二区| 欧美激情一区二区三区在线视频观看 | 亚洲第一二三四五区| 久久精品99国产精品酒店日本| 国产日韩欧美综合精品| 欧美一区二区私人影院日本| 久久久久久9999| 亚洲精品美女在线观看| 欧美成人午夜| 欧美aⅴ一区二区三区视频| 亚洲视频免费在线| 亚洲婷婷综合久久一本伊一区| 欧美国产日本韩| 亚洲国产天堂久久国产91| 亚洲激情国产精品| 亚洲视频高清| 欧美制服第一页| 欧美88av| 国产欧美一区二区在线观看| 亚洲国产精品va在线观看黑人| 亚洲日本在线视频观看| 一区在线播放| 欧美成人情趣视频| 久久av资源网站| 91久久精品日日躁夜夜躁国产| 国产精品嫩草影院一区二区| 欧美日韩不卡一区| 欧美日韩一级片在线观看| 欧美在线欧美在线| 久久国内精品视频| 久久国产主播| 亚洲在线成人精品| 亚洲综合国产| 欧美在线观看视频在线 | 久久高清福利视频| 午夜精品一区二区三区在线视| 亚洲免费一区二区| 亚洲丰满在线| 亚洲人成在线观看网站高清| 91久久一区二区| 国产一二三精品| 亚洲精品久久嫩草网站秘色| 欧美福利影院| 亚洲一区在线免费| 久久久久九九九| 亚洲另类自拍| 亚洲综合三区| 欧美精品亚洲精品| 亚洲视频在线观看视频| 中文网丁香综合网| 99在线视频精品| 欧美高清视频一区二区三区在线观看| 麻豆亚洲精品| 欧美综合国产精品久久丁香| 欧美h视频在线| 欧美日韩国产va另类| 亚洲欧美伊人| 日韩视频在线你懂得| 亚洲日本aⅴ片在线观看香蕉| 亚洲网站在线观看| 99国产精品99久久久久久粉嫩| 午夜在线精品| 久久高清国产| 久久精品国产一区二区三| 久久在线免费观看视频| 亚洲激情成人| 欧美福利在线| 一本久道久久综合中文字幕| 亚洲女同同性videoxma| 欧美成人一区二区三区在线观看| 99视频精品在线| 99国产精品久久久久久久成人热 | 99在线|亚洲一区二区| 一本在线高清不卡dvd| 欧美日韩综合不卡| 亚洲国产老妈| 欧美日韩国产电影| 亚洲影院在线观看| 欧美一区精品| 夜夜精品视频一区二区| 日韩一级片网址| 国产一区美女| 亚洲国产电影| 狠狠色综合网站久久久久久久| 欧美不卡视频一区| 欧美亚洲成人免费| 久久综合成人精品亚洲另类欧美| 欧美精品v日韩精品v国产精品| 能在线观看的日韩av| 一区二区三区波多野结衣在线观看| 9久草视频在线视频精品| 一区二区免费在线播放| 欧美aa在线视频| 亚洲午夜精品一区二区| 久久精品国产亚洲5555| 亚洲人成网站在线观看播放| av不卡在线| 亚洲午夜一二三区视频| 久久av红桃一区二区小说| 欧美三级乱人伦电影| 久久在线91| 久久综合久久88| 欧美一级视频精品观看| 亚洲视频成人| 亚洲精品国久久99热| 亚洲区第一页| 在线欧美福利| 久久久久久网址| 久久精品一区四区|