锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美精品一区二区三区视频,国产精品久久久久久久午夜,亚洲一区二区免费在线http://www.shnenglu.com/nacci/category/1784.html鍏充簬C++鐨勬柟鏂歸潰闈?/description>zh-cnMon, 19 May 2008 21:57:46 GMTMon, 19 May 2008 21:57:46 GMT60MFC婕皥錛堜簲錛夆斺旀秷鎭殑璺敱錛?錛?/title><link>http://www.shnenglu.com/nacci/archive/2006/05/19/7395.html</link><dc:creator>nacci</dc:creator><author>nacci</author><pubDate>Fri, 19 May 2006 01:08:00 GMT</pubDate><guid>http://www.shnenglu.com/nacci/archive/2006/05/19/7395.html</guid><wfw:comment>http://www.shnenglu.com/nacci/comments/7395.html</wfw:comment><comments>http://www.shnenglu.com/nacci/archive/2006/05/19/7395.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/nacci/comments/commentRss/7395.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/nacci/services/trackbacks/7395.html</trackback:ping><description><![CDATA[     鎽樿: 緇х畫(huà)涓婁竴涓富棰樼洿綰夸笂婧殑娑堟伅涓婃璇村埌娑堟伅琚漿鍙戝埌浜?jiǎn)AfxWndProc錛岀戶緇? LRESULT聽(tīng)CALLBACKAfxWndProc(HWND聽(tīng)hWnd,聽(tīng)UINT聽(tīng)nMsg,聽(tīng)WPARAM聽(tīng)wParam,聽(tīng)LPARAM聽(tīng)lParam)聽(tīng){聽(tīng)聽(tīng)聽(tīng)聽(tīng)//聽(tīng)鈥β?tīng)聽(tīng)聽(tīng)?/聽(tīng)all聽(tīng)other聽(tīng)messages聽(tīng)route聽(tīng)through聽(tīng)message聽(tīng)map聽(tīng)聽(tīng)聽(tīng)聽(tīng)CWnd*聽(tīng)pWnd聽(tīng)=聽(tīng)CW...  <a href='http://www.shnenglu.com/nacci/archive/2006/05/19/7395.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/nacci/aggbug/7395.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/nacci/" target="_blank">nacci</a> 2006-05-19 09:08 <a href="http://www.shnenglu.com/nacci/archive/2006/05/19/7395.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>MFC婕皥錛堝洓錛夆斺旀秷鎭殑璺敱http://www.shnenglu.com/nacci/archive/2006/05/18/7365.htmlnaccinacciThu, 18 May 2006 09:29:00 GMThttp://www.shnenglu.com/nacci/archive/2006/05/18/7365.htmlhttp://www.shnenglu.com/nacci/comments/7365.htmlhttp://www.shnenglu.com/nacci/archive/2006/05/18/7365.html#Feedback2http://www.shnenglu.com/nacci/comments/commentRss/7365.htmlhttp://www.shnenglu.com/nacci/services/trackbacks/7365.html鏈変簡(jiǎn)娑堟伅鏄犲皠琛紝濡備綍鍒╃敤鍛紵娑堟伅濡備綍琚垎闂ㄥ埆綾葷殑媧懼彂鍑哄幓鐨勶紵


鐢ㄦ渶鍩烘湰鐨勪竴鍙ヨ瘽姒傝堪錛岄挬瀛愬嚱鏁拌搗浜?jiǎn)寰堝ぇ浣滅敤銆傛晠浜嬫槸榪欐牱鐨勶紝鏈変簺婕暱錛屼篃闇瑕佷簺鑰愬績(jī)銆?br />
MFC涓秷鎭垎涓?綾伙細(xì)

聽(tīng)1. WM_COMMAND錛氭墍鏈夌殑UI緇勪歡鍜屽姞閫熼敭閮戒細(xì)浜х敓榪欑娑堟伅錛屾墍鏈夋淳鐢熶簬CCmdTarget鐨勭被閮芥湁鑳藉姏澶勭悊璇ユ秷鎭?br />聽(tīng)2. 鏍囧噯娑堟伅錛氶櫎WM_COMMAND涔嬪鐨刉M_xx娑堟伅閮芥槸鏍囧噯娑堟伅錛屾淳鐢熶簬CWnd鐨勭被閮芥湁鑳藉姏澶勭悊璇ユ秷鎭?br />聽(tīng)3. 鎺т歡閫氱煡娑堟伅錛氱敤浜庡瓙紿楀彛鎺т歡鍚戠埗紿楀彛鍙戦佺殑娑堟伅

鍦∕FC鐨勬秷鎭槧灝勮〃鐨勫緩绔嬩腑錛岄氳繃涓緇勫畯錛屼綘灝卞彲浠ヨ鑷繁鐨勭被鍏堜簬鐖剁被澶勭悊鏌愪簺Windows娑堟伅錛岃繖縐嶈涓哄緢鍍忚櫄鍑芥暟錛屽彧鏄垜浠噸杞界殑鍐呭涓嶆槸铏氬嚱鏁幫紝鑰屾槸娑堟伅銆?/font>

鎺ㄥ姩娑堟伅鐨勬車(chē)

絎竴闃舵 紿楀彛榪囩▼

鍦ㄤ駭鐢熶竴涓獥鍙g殑鏃跺欙紝浼?xì)璋冪敤CFrameWnd::Create錛屾墍鏈夌殑鏁呬簨涔熼兘浠庤繖閲屽睍寮銆備笅闈㈢殑浠g爜涓轟簡(jiǎn)綆媧侊紝鍘繪帀浜?jiǎn)涓嶇浉鍏崇殑浠g?br />

BOOL聽(tīng)CFrameWnd::Create(鈥?聽(tīng) {
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
// 聽(tīng)鈥?/span>

聽(tīng)聽(tīng)聽(tīng)聽(tīng) if 聽(tīng)( ! CreateEx(鈥?)聽(tīng) {
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
// 聽(tīng)鈥?/span>

聽(tīng)聽(tīng)聽(tīng)聽(tīng)}

聽(tīng)聽(tīng)聽(tīng)聽(tīng)
// 聽(tīng)鈥?/span>
}


BOOL聽(tīng)CWnd::CreateEx(鈥?聽(tīng)
{
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
// 聽(tīng)鈥?/span>

聽(tīng)聽(tīng)聽(tīng)聽(tīng)AfxHookWindowCreate( this );
聽(tīng)聽(tīng)聽(tīng)聽(tīng)HWND聽(tīng)hWnd聽(tīng)
=
聽(tīng)::CreateWindowEx(鈥?;
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
// 聽(tīng)鈥?/span>

}


void 聽(tīng)AFXAPI聽(tīng)AfxHookWindowCreate(CWnd * 聽(tīng)pWnd)聽(tīng) {
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
// 聽(tīng)鈥?/span>

聽(tīng)聽(tīng)聽(tīng)聽(tīng) if 聽(tīng)(pThreadState -> m_hHookOldCbtFilter聽(tīng) == 聽(tīng)NULL)聽(tīng) {
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)pThreadState
-> m_hHookOldCbtFilter聽(tīng) =
聽(tīng)::SetWindowsHookEx(WH_CBT,
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)_AfxCbtFilterHook,聽(tīng)NULL,聽(tīng)::GetCurrentThreadId());
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
// 聽(tīng)鈥?/span>

聽(tīng)聽(tīng)聽(tīng)聽(tīng)}

聽(tīng)聽(tīng)聽(tīng)聽(tīng)
// 聽(tīng)鈥?/span>
聽(tīng)聽(tīng)聽(tīng)聽(tīng)pThreadState -> m_pWndInit聽(tīng) = 聽(tīng)pWnd;
}

榪欐牱錛岄氳繃AfxHookWindowCreate錛屽湪褰撳墠綰跨▼涓畨瑁呬簡(jiǎn)涓涓挬瀛愶紝鐢ㄦ潵鎷︽埅鍜岀獥鍙g浉鍏崇殑浜嬩歡錛屾瘡褰擄細(xì)

1. 鍙︿竴涓獥鍙f垚涓篴ctive錛?br />2. 浜х敓鎴栨懅姣佷竴涓獥鍙?br />3. Minimize鎴杕aximize涓涓獥鍙o紱
4. 縐誨姩鎴栫緝鏀句竴涓獥鍙o紱
5. 瀹屾垚涓涓潵鑷郴緇熻彍鍗曠殑鍛戒護(hù)錛?br />6. 浠庣郴緇熼槦鍒椾腑鍙栧嚭涓涓秷鎭紱

鏃訛紝閮戒細(xì)鍏堣皟鐢╛AfxCbtFilterHook錛屾帴涓嬫潵鐪嬬湅閽╁瓙鍑芥暟浣滀簡(jiǎn)浠涔堬細(xì)

LRESULT聽(tīng)CALLBACK
_AfxCbtFilterHook(
int 聽(tīng)code,聽(tīng)WPARAM聽(tīng)wParam,聽(tīng)LPARAM聽(tīng)lParam)聽(tīng)
{
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
// 聽(tīng)鈥?/span>

聽(tīng)聽(tīng)聽(tīng)聽(tīng)WNDPROC聽(tīng)afxWndProc聽(tīng) = 聽(tīng)AfxGetAfxWndProc();
聽(tīng)聽(tīng)聽(tīng)聽(tīng)oldWndProc聽(tīng)
=
聽(tīng)(WNDPROC)SetWindowLongPtr(hWnd,聽(tīng)GWLP_WNDPROC,(DWORD_PTR)afxWndProc);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
// 聽(tīng)鈥?/span>

}


WNDPROC聽(tīng)AFXAPI聽(tīng)AfxGetAfxWndProc()聽(tīng)
{
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
// 聽(tīng)鈥?/span>

聽(tīng)聽(tīng)聽(tīng)聽(tīng) return 聽(tīng) & AfxWndProc;
}

榪欐牱錛宊AfxCbtFilterHook鐨勫伐浣滄葷粨璧鋒潵灝辨槸閫氳繃紿楀彛瀛愮被鍖栵紝鎶婃柊寤虹殑紿楀彛鐨勭獥鍙h繃紼嬭緗垚AfxWndProc銆?br />鍒拌繖閲岋紝鎴戜滑緇堜簬鎵懼埌浜?jiǎn)绐楀彛杩嚱E嬨?br />
緇撹
CFrameWnd::Create鍒涘緩紿楀彛璋冪敤CWnd::CreateEx
CWnd::CreateEx璋冪敤AfxHookWindowCreate鍑嗗涓虹獥鍙h緗挬瀛?br />AfxHookWindowCreate璋冪敤::SetWindowHookEx涓虹獥鍙h緗簡(jiǎn)涓涓猈H_CBT綾誨瀷鐨勯挬瀛愭潵榪囨護(hù)娑堟伅錛屽茍鎶婅繃婊ゅ嚱鏁拌緗垚_AfxCbtFilterHook
_AfxCbtFilterHook閫氳繃紿楀彛瀛愮被鍖栬緗獥鍙g殑紿楀彛榪囩▼涓篈fxWndProc
榪欐牱錛岄氳繃::DispatchMessage鍙戦佺粰紿楀彛鐨勬秷鎭氨浼?xì)婧愭簮涓嶆柇鍦伴佸埌AfxWndProc涓潵錛屽彲浠ユ兂鍒幫紝AfxWndProc鍒╃敤MFC鐨勬秷鎭槧灝勮〃錛屽垎闂ㄥ埆綾葷殑瀵規(guī)秷鎭繘琛屽垎嫻併?br />
錛堝緟緇︹︼級(jí)




nacci 2006-05-18 17:29 鍙戣〃璇勮
]]>
MFC婕皥錛堜笁錛夆斺旀秷鎭槧灝?/title><link>http://www.shnenglu.com/nacci/archive/2006/05/18/7363.html</link><dc:creator>nacci</dc:creator><author>nacci</author><pubDate>Thu, 18 May 2006 08:31:00 GMT</pubDate><guid>http://www.shnenglu.com/nacci/archive/2006/05/18/7363.html</guid><wfw:comment>http://www.shnenglu.com/nacci/comments/7363.html</wfw:comment><comments>http://www.shnenglu.com/nacci/archive/2006/05/18/7363.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.shnenglu.com/nacci/comments/commentRss/7363.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/nacci/services/trackbacks/7363.html</trackback:ping><description><![CDATA[ <p> <font size="2">MFC涓殑娑堟伅寰幆鍛紵鎴戜滑鐔熸?zhèn)夌殑switch鈥︹ase鈥︹﹀埌鍝噷鍘諱簡(jiǎn)錛?br /></font> </p> <font size="2"> <hr /> <br />鍦∕FC涓紝娑堟伅鐨勫驚鐜茍涓嶆槸鐢╯witch鈥︹ase鈥︹﹀疄鐜扮殑錛屽畠渚濊禆浜庝竴寮犵敱紼嬪簭鑷韓瀹氫箟鐨勬秷鎭綉銆?br /><br />棣栧厛錛孧FC鐢ㄤ竴涓悕涓篈FX_MSGMAP_ENTRY緇撴瀯鏉ュ娑堟伅鐨勪俊鎭繘琛屽皝瑁咃細(xì) </font> <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"> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #0000ff">struct</span> </font> <font size="2"> <span style="COLOR: #000000">聽(tīng)AFX_MSGMAP_ENTRY<br /><img id="Codehighlighter1_24_379_Open_Image" onclick="this.style.display='none'; Codehighlighter1_24_379_Open_Text.style.display='none'; Codehighlighter1_24_379_Closed_Image.style.display='inline'; Codehighlighter1_24_379_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_24_379_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_24_379_Closed_Text.style.display='none'; Codehighlighter1_24_379_Open_Image.style.display='inline'; Codehighlighter1_24_379_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_24_379_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> </font> <span id="Codehighlighter1_24_379_Open_Text"> <font size="2"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />銆銆UINT聽(tīng)nMessage;聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽(tīng)windows聽(tīng)message</span> </font> <span style="COLOR: #008000"> <br /> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /> </font> </span> <font size="2"> <span style="COLOR: #000000">銆銆UINT聽(tīng)nCode;聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)銆</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽(tīng)control聽(tīng)code聽(tīng)or聽(tīng)WM_NOTIFY聽(tīng)code</span> </font> <span style="COLOR: #008000"> <br /> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /> </font> </span> <font size="2"> <span style="COLOR: #000000">銆銆UINT聽(tīng)nID;聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)銆銆</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽(tīng)control聽(tīng)I(yíng)D聽(tīng)(or聽(tīng)0聽(tīng)for聽(tīng)windows聽(tīng)messages)</span> </font> <span style="COLOR: #008000"> <br /> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /> </font> </span> <font size="2"> <span style="COLOR: #000000">銆銆UINT聽(tīng)nLastID;聽(tīng)聽(tīng)聽(tīng)聽(tīng)銆</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽(tīng)used聽(tīng)for聽(tīng)entries聽(tīng)specifying聽(tīng)a聽(tīng)range聽(tīng)of聽(tīng)control聽(tīng)id's</span> </font> <span style="COLOR: #008000"> <br /> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /> </font> </span> <font size="2"> <span style="COLOR: #000000">銆銆UINT_PTR聽(tīng)nSig;聽(tīng)聽(tīng)聽(tīng)銆</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽(tīng)signature聽(tīng)type聽(tīng)(action)聽(tīng)or聽(tīng)pointer聽(tīng)to聽(tīng)message聽(tīng)#</span> </font> <span style="COLOR: #008000"> <br /> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /> </font> </span> <font size="2"> <span style="COLOR: #000000">銆銆AFX_PMSG聽(tīng)pfn;聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽(tīng)routine聽(tīng)to聽(tīng)call聽(tīng)(or聽(tīng)special聽(tīng)value)</span> </font> <span style="COLOR: #008000"> <br /> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /> </font> </span> <span style="COLOR: #000000"> <font size="2">}</font> </span> </span> <span style="COLOR: #000000"> <font size="2">;</font> </span> </div> <p> <font size="2">鍏朵腑銆typedef void (AFX_MSG_CALL CCmdTarget::*AFX_PMSG)(void);<br /><br />涔嬪悗錛岄氳繃涓涓摼琛紝鎶婅繖浜涙弿榪版秷鎭殑緇撴瀯緇勭粐璧鋒潵錛屾瀯鎴愭秷鎭槧灝勮〃鐨勭粨鏋勬槸AFX_MSGMAP</font> </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"> <font size="2"> <img id="Codehighlighter1_18_87_Open_Image" onclick="this.style.display='none'; Codehighlighter1_18_87_Open_Text.style.display='none'; Codehighlighter1_18_87_Closed_Image.style.display='inline'; Codehighlighter1_18_87_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_18_87_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_18_87_Closed_Text.style.display='none'; Codehighlighter1_18_87_Open_Image.style.display='inline'; Codehighlighter1_18_87_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> <span style="COLOR: #0000ff">struct</span> <span style="COLOR: #000000">聽(tīng)AFX_MSGMAP銆</span> <span id="Codehighlighter1_18_87_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> </font> <span id="Codehighlighter1_18_87_Open_Text"> <font size="2"> <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">聽(tīng)AFX_MSGMAP</span> <span style="COLOR: #000000">*</span> </font> <font size="2"> <span style="COLOR: #000000">聽(tīng)pBaseMap;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />銆銆</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)AFX_MSGMAP_ENTRY</span> <span style="COLOR: #000000">*</span> </font> <span style="COLOR: #000000"> <font size="2">聽(tīng)lpEntries;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</font> </span> </span> <span style="COLOR: #000000"> <font size="2">;</font> </span> </div> <p> <font size="2">榪欐牱涓涓狝FX_MSGMAP瀵硅薄灝辨垚浜?jiǎn)鏋勫缓娑堟伅鏄牉畡琛ㄧ殑鍏抽敭錆h鐗╋紝瀹冧竴鍙墜鎷夌潃鍩虹被鐨凙FX_MSGMAP瀵硅薄錛屽彟涓鍙墜鎷夌潃綾繪湰韜殑娑堟伅鏄犲皠琛紝榪欐牱鍙姝g‘鍦板湪姣忎竴涓被涓兘瀹夋彃涓涓狝FX_MSGMAP瀵硅薄錛岄偅涔堟暣涓秷鎭槧灝勮〃灝卞緩绔嬭搗鏉ヤ簡(jiǎn)銆傞偅涔堬紝浣曚負(fù)姝g‘鍛紵鍚箟鏈?錛氫竴鏄紜殑璁劇疆pBaseMap錛屼護(hù)瀹冩寚鍚戝熀綾伙紝浜屾槸姝g‘鐨勫緩绔嬬被鑷韓鐨勬秷鎭槧灝勮〃銆傝繖涓や釜宸ヤ綔鏄敱4涓畯瀹屾垚鐨勶紝<br /><br />瀹冧滑鏄細(xì)DECLARE_MEMSSAGE_MAP() / BEGIN_MESSAGE_MAP() / ON_COMMAND()錛堟敞錛歄N_COMMAND瀹忓彧鏄負(fù)浜?jiǎn)澶勭悊鍛戒护娑堟伅锛屽浜庡叾瀹冪殑娑堟伅杩樻湁瀵瑰簲鐨勫畯锛屼絾鏄師鐞嗘槸鐩稿悓鐨勫Q?/ END_MESSAGE_MAP()銆?br />璁╂垜浠竴涓釜鐨勭湅鐪嬶細(xì)</font> </p> <p> <font size="2"> </font> </p> <p> <font size="2"> </font> </p> <p> <font size="2"> </font> </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"> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #0000ff">#define</span> <span style="COLOR: #000000">聽(tīng)DECLARE_MESSAGE_MAP()聽(tīng)\</span> </font> <span style="COLOR: #000000"> <br /> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </font> </span> <font size="2"> <span style="COLOR: #0000ff">private</span> </font> <font size="2"> <span style="COLOR: #000000">:聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />銆銆</span> <span style="COLOR: #0000ff">static</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">const</span> </font> <font size="2"> <span style="COLOR: #000000">聽(tīng)AFX_MSGMAP_ENTRY聽(tīng)_messageEntries[];聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #0000ff">protected</span> </font> <font size="2"> <span style="COLOR: #000000">:聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />銆銆</span> <span style="COLOR: #0000ff">static</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">const</span> </font> <font size="2"> <span style="COLOR: #000000">聽(tīng)AFX_MSGMAP聽(tīng)messageMap;聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />銆銆</span> <span style="COLOR: #0000ff">virtual</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)AFX_MSGMAP</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">聽(tīng)GetMessageMap()聽(tīng)</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">;聽(tīng)\</span> </font> </div> <p> <font size="2">榪欎釜瀹忕殑浣滅敤鏈?錛?br />聽(tīng)1. 鍦ㄧ被涓彃鍏ヤ竴涓潤(rùn)鎬佹垚鍛榑messageEntries錛岃繖鏄敤鏉ュ瓨鏀劇被瑕佸鐞嗙殑娑堟伅鐨勬暟緇勶紙鍗崇被鏈韓鐨勬秷鎭槧灝勮〃錛?br />聽(tīng)2.聽(tīng) 鍙︿竴涓潤(rùn)鎬佹垚鍛榤assageMap鐢ㄦ潵鎸囧悜鍩虹被鐨勬秷鎭槧灝勮〃<br />聽(tīng)3. 瀹夋彃涓涓櫄鍑芥暟錛屽叾鍐呭鏈夊緟瀹炵幇</font> </p> <p> <font size="2">鎺ヤ笅鏉ワ紝_messageEntries鐨勫垵濮嬪寲錛宮essageMap鐨勬紜寚鍚戯紝GetMessageMap鍑芥暟鐨勫疄鐜拌繖浜涘伐浣滆繕閮芥病鍋氾紝閭f鏄悗涓変釜瀹忕殑璐d換錛屽畠浠欏哄簭浣跨敤錛屾柟鑳藉伐浣滄甯搞?</font> </p> <p> <font size="2"> </font> </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"> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #0000ff">#define</span> <span style="COLOR: #000000">聽(tīng)BEGIN_MESSAGE_MAP(theClass,聽(tīng)baseClass)聽(tīng)\</span> </font> <span style="COLOR: #000000"> <br /> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽(tīng)聽(tīng)</font> </span> <font size="2"> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)AFX_MSGMAP</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">聽(tīng)theClass::GetMessageMap()聽(tīng)</span> <span style="COLOR: #0000ff">const</span> </font> <font size="2"> <span style="COLOR: #000000">聽(tīng)\<br /><img id="Codehighlighter1_107_139_Open_Image" onclick="this.style.display='none'; Codehighlighter1_107_139_Open_Text.style.display='none'; Codehighlighter1_107_139_Closed_Image.style.display='inline'; Codehighlighter1_107_139_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_107_139_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_107_139_Closed_Text.style.display='none'; Codehighlighter1_107_139_Open_Image.style.display='inline'; Codehighlighter1_107_139_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />聽(tīng)聽(tīng)</span> <span id="Codehighlighter1_107_139_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_107_139_Open_Text"> <span style="COLOR: #000000">{聽(tīng)</span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">&</span> <span style="COLOR: #000000">theClass::messageMap;聽(tīng)}</span> </span> </font> <font size="2"> <span style="COLOR: #000000">聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽(tīng)聽(tīng)AFX_COMDAT聽(tīng)</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)AFX_MSGMAP聽(tīng)theClass::messageMap聽(tīng)</span> <span style="COLOR: #000000">=</span> </font> <font size="2"> <span style="COLOR: #000000">聽(tīng)\<br /><img id="Codehighlighter1_202_258_Open_Image" onclick="this.style.display='none'; Codehighlighter1_202_258_Open_Text.style.display='none'; Codehighlighter1_202_258_Closed_Image.style.display='inline'; Codehighlighter1_202_258_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_202_258_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_202_258_Closed_Text.style.display='none'; Codehighlighter1_202_258_Open_Image.style.display='inline'; Codehighlighter1_202_258_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />聽(tīng)聽(tīng)</span> <span id="Codehighlighter1_202_258_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_202_258_Open_Text"> <span style="COLOR: #000000">{聽(tīng)</span> <span style="COLOR: #000000">&</span> <span style="COLOR: #000000">baseClass::messageMap,聽(tīng)</span> <span style="COLOR: #000000">&</span> <span style="COLOR: #000000">theClass::_messageEntries[</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">]聽(tīng)}</span> </span> </font> <font size="2"> <span style="COLOR: #000000">;聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽(tīng)聽(tīng)AFX_COMDAT聽(tīng)</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)AFX_MSGMAP_ENTRY聽(tīng)theClass::_messageEntries[]聽(tīng)</span> <span style="COLOR: #000000">=</span> </font> <font size="2"> <span style="COLOR: #000000">聽(tīng)\<br /><img id="Codehighlighter1_334_338_Open_Image" onclick="this.style.display='none'; Codehighlighter1_334_338_Open_Text.style.display='none'; Codehighlighter1_334_338_Closed_Image.style.display='inline'; Codehighlighter1_334_338_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_334_338_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_334_338_Closed_Text.style.display='none'; Codehighlighter1_334_338_Open_Image.style.display='inline'; Codehighlighter1_334_338_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />聽(tīng)</span> <span id="Codehighlighter1_334_338_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_334_338_Open_Text"> <span style="COLOR: #000000">{聽(tīng)\</span> </span> </font> </div> <p> <font size="2">榪欎釜瀹忕殑浣滅敤鏈?錛?br />1. 瀹氫箟浜?jiǎn)瀹夋彃鍦ňc諱腑鐨勮櫄鍑芥暟GetMessageMap()錛屽彧鏄畝鍗曠殑榪斿洖messageMap瀵硅薄鐨勫湴鍧<br />2. 鍒濆鍖杕essageMap錛屾妸媧劇敓綾誨拰鍩虹被鑱旂郴璧鋒潵鏋勬垚涓涓ぇ鐨勬秷鎭槧灝勮〃<br />3. 涓虹被鏈韓鐨勬秷鎭槧灝勮〃鐨勫垵濮嬪寲鍋氳娉曞噯澶?/font> </p> <p> <font size="2">ON_COMMAND榪欎釜瀹忕殑浣滅敤灝辨槸鍚慱messageEntries鏁扮粍涓坊鍔犵被鏈韓瑕佸鐞嗙殑鍛戒護(hù)娑堟伅錛屽叾瀹炲湪MFC涓繕鏈夊緢澶氭洿鏂逛究鐨勫畯鍙互鍚戠被涓坊鍔犳秷鎭紝渚嬪OM_WM_PAINT絳夛紝榪欓噷錛屾垜浠富瑕佽璁篛N_COMMAND錛屾瘯绔熷師鐞嗛兘鏄浉鍚岀殑銆?br /></font> </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"> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #0000ff">#define</span> <span style="COLOR: #000000">聽(tīng)ON_COMMAND(id,聽(tīng)memberFxn)聽(tīng)\</span> </font> <span style="COLOR: #000000"> <br /> <font size="2"> <img id="Codehighlighter1_37_135_Open_Image" onclick="this.style.display='none'; Codehighlighter1_37_135_Open_Text.style.display='none'; Codehighlighter1_37_135_Closed_Image.style.display='inline'; Codehighlighter1_37_135_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_37_135_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_37_135_Closed_Text.style.display='none'; Codehighlighter1_37_135_Open_Image.style.display='inline'; Codehighlighter1_37_135_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </font> </span> <span id="Codehighlighter1_37_135_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"> <font size="2"> <img src="http://www.shnenglu.com/images/dot.gif" /> </font> </span> <font size="2"> <span id="Codehighlighter1_37_135_Open_Text"> <span style="COLOR: #000000">{聽(tīng)WM_COMMAND,聽(tīng)CN_COMMAND,聽(tīng)(WORD)id,聽(tīng)(WORD)id,聽(tīng)AfxSigCmd_v,聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />聽(tīng)聽(tīng)static_cast</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">AFX_PMSG</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">聽(tīng)(memberFxn)聽(tīng)}</span> </span> <span style="COLOR: #000000">,</span> </font> </div> <p> <font size="2">鏃犻潪鏄AFX_MSG_ENTRY緇撴瀯鐨勫垵濮嬪寲錛岃繖鏍峰湪綾諱腑涓烘瘡涓涓兂瑕佸鐞嗙殑娑堟伅閮芥槸鐢ㄤ竴涓狾N_COMMAND瀹忥紝灝辮嚜鍔ㄧ殑鍒濆鍖栦簡(jiǎn)綾繪湰韜殑娑堟伅鏄犲皠琛ㄣ?/font> </p> <p> <font size="2">鏈鍚庯紝褰撳叏閮ㄧ殑淇℃伅娣誨姞瀹屾瘯鍚庯紝浣跨敤END_MESSAGE_MAP()瀹忛氱煡MFC涓涓被娑堟伅鏄犲皠琛ㄧ粨鏉熶簡(jiǎn)銆?br /></font> </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"> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #0000ff">#define</span> <span style="COLOR: #000000">聽(tīng)END_MESSAGE_MAP()聽(tīng)\</span> </font> <span style="COLOR: #000000"> <br /> <font size="2"> <img id="Codehighlighter1_31_68_Open_Image" onclick="this.style.display='none'; Codehighlighter1_31_68_Open_Text.style.display='none'; Codehighlighter1_31_68_Closed_Image.style.display='inline'; Codehighlighter1_31_68_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_31_68_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_31_68_Closed_Text.style.display='none'; Codehighlighter1_31_68_Open_Image.style.display='inline'; Codehighlighter1_31_68_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />聽(tīng)聽(tīng)</font> </span> <font size="2"> <span id="Codehighlighter1_31_68_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_31_68_Open_Text"> <span style="COLOR: #000000">{</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">,聽(tīng)</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">,聽(tīng)</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">,聽(tīng)</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">,聽(tīng)AfxSig_end,聽(tīng)(AFX_PMSG)</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">聽(tīng)}</span> </span> </font> <font size="2"> <span style="COLOR: #000000">聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽(tīng)};聽(tīng)\</span> </font> </div> <p> <font size="2">瀹炵幇鎵嬫硶鍗曠函寰楀緢錛屾棤闈炴槸涓涓叏0鐨凙FX_MESSAGE_MAP瀵硅薄銆?br /><br /></font> <font size="2"> <strong> <font size="3">緇撹<br /></font> </strong>鎯寵璁╀綘鐨勭被澶勭悊鏌愪釜娑堟伅錛屼嬌鐢ㄤ笅闈㈢殑緇勫悎錛?/font> </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"> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000">BEGIN_MESSAGE_MAP(theClass,聽(tīng)the聽(tīng)</span> <span style="COLOR: #0000ff">base</span> </font> <font size="2"> <span style="COLOR: #000000">聽(tīng)Class)<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">娑堟伅澶勭悊瀹?/span> </font> <span style="COLOR: #008000"> <br /> <font size="2"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </font> </span> <font size="2"> <span style="COLOR: #000000">END_MESSAGE_MAP()</span> </font> </div> <br /> <font size="2">錛堝緟緇︹︼級(jí)</font> <img src ="http://www.shnenglu.com/nacci/aggbug/7363.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/nacci/" target="_blank">nacci</a> 2006-05-18 16:31 <a href="http://www.shnenglu.com/nacci/archive/2006/05/18/7363.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>MFC婕皥錛堜簩錛夆斺斿璞$殑鍔ㄦ佸垱寤?/title><link>http://www.shnenglu.com/nacci/archive/2006/05/18/7355.html</link><dc:creator>nacci</dc:creator><author>nacci</author><pubDate>Thu, 18 May 2006 08:07:00 GMT</pubDate><guid>http://www.shnenglu.com/nacci/archive/2006/05/18/7355.html</guid><wfw:comment>http://www.shnenglu.com/nacci/comments/7355.html</wfw:comment><comments>http://www.shnenglu.com/nacci/archive/2006/05/18/7355.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/nacci/comments/commentRss/7355.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/nacci/services/trackbacks/7355.html</trackback:ping><description><![CDATA[ <p> <font size="2">鎺ヤ笂嬈TTI鐨勮瘽棰樸?br /><hr /><br />鑳藉鍦ㄨ繍琛屾椂鍙戠幇涓涓璞$殑綾誨瀷錛屽氨鍙互鍦ㄨ繍琛屾椂鍔ㄦ佺殑鍒涘緩涓涓璞°傚湪涓涓被搴撲腑錛屾嫢鏈夌粺涓鐨勫璞″垱寤烘柟寮忔槸闈炲父閲嶈鐨勩?br /><p></p><p>鍦∕FC涓紝瀵硅薄鐨勫姩鎬佸垱寤鴻渚濊禆浜嶳TTI鎵寤虹珛璧鋒潵鐨勭被鍒瀷褰曪紝鍜屽姩鎬佸垱寤烘湁鍏崇殑CRuntimeClass鎴愬憳鏈変袱涓細(xì)</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">CObject</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(tīng)(PASCAL</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(tīng)m_pfnCreateObject)();聽(tīng)</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)鎸囧悜鐢ㄤ簬鍒涘緩瀵硅薄鐨勫嚱鏁?/span><span style="COLOR: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">CObject</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(tīng)CreateObject();聽(tīng)</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)鍒╃敤m_pfnCreateObject鍒涘緩瀵硅薄</span></div><p>鍒╃敤RTTI寤虹珛鐨勭被鍒瀷褰曪紝DECLARE_DYNCREATE / IMPLEMENT_DYNCREATE緇х畫(huà)涓虹被娣誨姞浜?jiǎn)鍔ㄦ佸垱寤虹殑鍔熻兘銆?/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: #0000ff">#define</span><span style="COLOR: #000000">聽(tīng)DECLARE_DYNCREATE聽(tīng)(class_name)聽(tīng)\</span><span style="COLOR: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />銆銆銆銆DECLARE_DYNAMIC聽(tīng)(class_name)聽(tīng)\聽(tīng)<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />銆銆銆銆</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">聽(tīng)CObject</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(tīng)PASCAL聽(tīng)CreateObject();</span></div><p>榪欎釜瀹忓悓鏍風(fēng)敤鍦ㄧ被澹版槑涓紝瀹冧笉浣嗕負(fù)綾繪坊鍔犱簡(jiǎn)class##class_name瀵硅薄鍜孏etRuntimeClass()錛岃繕?shù)负绫诲姞鍏ヤ簡(jiǎn)涓涓潤(rùn)鎬佸嚱鏁癈reateObject,鐢ㄦ潵榪涜瀵硅薄鐨勫姩鎬佸垱寤恒傚悓鏍稩MPLEMENT_DYNCREATE鐢ㄦ潵瀵逛笂闈㈡坊鍔犵殑鍐呭浣滃畾涔夊拰鍒濆鍖栧伐浣溿?/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: #0000ff">#define</span><span style="COLOR: #000000">聽(tīng)I(yíng)MPLEMENT_DYNCREATE聽(tīng)(class_name,聽(tīng)base_class_name)聽(tīng)\</span><span style="COLOR: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />銆銆銆銆CObject</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(tīng)PASCAL聽(tīng)class_name::CreateObject()聽(tīng)\<br /><img id="Codehighlighter1_115_140_Open_Image" onclick="this.style.display='none'; Codehighlighter1_115_140_Open_Text.style.display='none'; Codehighlighter1_115_140_Closed_Image.style.display='inline'; Codehighlighter1_115_140_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_115_140_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_115_140_Closed_Text.style.display='none'; Codehighlighter1_115_140_Open_Image.style.display='inline'; Codehighlighter1_115_140_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" />銆銆銆銆</span><span id="Codehighlighter1_115_140_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_115_140_Open_Text"><span style="COLOR: #000000">{聽(tīng)</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽(tīng)class_name;聽(tīng)}</span></span><span style="COLOR: #000000">聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />銆銆銆銆IMPLEMENT_RUNTIMECLASS聽(tīng)(class_name,聽(tīng)base_class_name,聽(tīng)</span><span style="COLOR: #000000">0xFFFF</span><span style="COLOR: #000000">,聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />銆銆銆銆class_name::CreateObject,聽(tīng)NULL)</span></div><p>鍜孖MPLEMENT_DYNAMIC涓嶅悓鐨勬槸錛岃繖閲岀殑IMPLEMENT_RUNTIMECLASS涓殑絎?涓弬鏁板茍涓嶄負(fù)NULL錛岃屾槸class_name::CreateObject錛岃繖鏍峰氨鎸囧畾浜?jiǎn)鐢ㄤ簬鍒涘缓瀵硅薄鐨勫嚱鏁板Q岃嚦浜庡叾瀹冪殑鍐呭錛屼笌RTTI娌℃湁浠涔堜笉鍚屻?br /><br />浜庢槸錛屾暣涓璞$殑鍔ㄦ佸垱寤鴻繃紼嬪氨鍙樺緱闈炲父綆鍗曚簡(jiǎn)錛屽彧瑕佹垜浠壘鍒版煇涓壒瀹氱被鐨凜RuntimeClass瀵硅薄錛屽埄鐢╟lass##class_name.CreateObject()灝卞彲浠ヤ簡(jiǎn)銆?/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">CObject</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(tīng)CRuntimeClass::CreateObject()<br /><img id="Codehighlighter1_39_122_Open_Image" onclick="this.style.display='none'; Codehighlighter1_39_122_Open_Text.style.display='none'; Codehighlighter1_39_122_Closed_Image.style.display='inline'; Codehighlighter1_39_122_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_39_122_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_39_122_Closed_Text.style.display='none'; Codehighlighter1_39_122_Open_Image.style.display='inline'; Codehighlighter1_39_122_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_39_122_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_39_122_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />銆銆CObject</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(tīng)pObject聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)NULL;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />銆銆pObject聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)(</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">m_pfnCreateObject)();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />銆銆</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽(tīng)pObject;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div><p><font size="3"><strong>緇撹<br /></strong></font>鎯寵浣犵殑綾誨湪MFC涓敮鎸佸姩鎬佸垱寤猴紝<br />1.聽(tīng)鍦ㄧ被澹版槑涓嬌鐢―ECLARE_DYNAMIC<br />2. 鍦ㄧ被瀹氫箟鏂囦歡涓嬌鐢↖MPLEMENT_DYNAMIC錛屾鏃?br />聽(tīng)聽(tīng)聽(tīng) class##class_name.m_pfnCreateObject = class_name::CreateObject;銆<br />聽(tīng)聽(tīng)聽(tīng) CRuntimeClass::CreateObject鍒╃敤m_pfnCreateObject灝卞彲浠ヨ繘琛屽璞$殑鍔ㄦ佸垱寤轟簡(jiǎn)<br />聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) 錛堝緟緇︹︼級(jí)<br /></p></font> </p> <p> </p> <img src ="http://www.shnenglu.com/nacci/aggbug/7355.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/nacci/" target="_blank">nacci</a> 2006-05-18 16:07 <a href="http://www.shnenglu.com/nacci/archive/2006/05/18/7355.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>MFC婕皥錛堜竴錛夆斺擱TTIhttp://www.shnenglu.com/nacci/archive/2006/05/18/7350.htmlnaccinacciThu, 18 May 2006 06:53:00 GMThttp://www.shnenglu.com/nacci/archive/2006/05/18/7350.htmlhttp://www.shnenglu.com/nacci/comments/7350.htmlhttp://www.shnenglu.com/nacci/archive/2006/05/18/7350.html#Feedback1http://www.shnenglu.com/nacci/comments/commentRss/7350.htmlhttp://www.shnenglu.com/nacci/services/trackbacks/7350.html鎵鏈夌殑榪欎竴緋誨垪鐨勪笢瑗塊兘鏉ユ簮浜庡墠澶╂櫄涓婄殑涓涓數(shù)璇濓紝鍐呭澶ф鏄錛?/span> 浣犺兘鏁欎細(xì)鎴戜竴涓鎴戝 鏈夌偣鎰熻鐨?/span> 鍚楋紵鎴戞復(fù)鏈涗竴涓儚鐢?/span> 鍐欑殑 涓鏍風(fēng)洿瑙傜殑渚嬪瓙銆?/span> 鎯蟲(chóng)兂榪欐浘緇忔槸鎴戝涔?/span> 鐨勬椂鍊欎篃鎯沖埌榪囩殑闂銆傛垜鏄竴涓枩嬈㈠埁鏍歸棶搴曠殑浜猴紝鍠滄鎶婁簨鎯呮悶鏄庣櫧錛屼簬鏄浘緇忓緢闀跨殑涓孌墊椂闂撮噷錛屾垜閮藉洶鎯戝湪綰風(fēng)箒鏉備貢鐨勪唬鐮侀噷銆傜幇鍦ㄥ洖鎯寵搗鏉ワ紝渚嵎鑰佸笀鐨勩?/span> 銆嬪拰 鐨勩?/span> 銆嬩竴璧瘋鏉ワ紝浼拌鑳借揪鍒拌В鎯戠殑鐩殑銆傚綋鐒?dòng)灱岄渶瑕佺殑鏄竴鐐圭偣鑰愬績(jī)鍜屽 紼嬪簭鐨勪竴鐐規(guī)渶鍩烘湰鐨勪簡(jiǎn)瑙o紙璨屼技搴熻瘽銆傘傘傦級(jí)銆備簬鏄偅澶╂櫄涓婏紝 涓婂拰閭d釜鏈嬪弸鑱婁簡(jiǎn)鎸洪暱涓孌墊椂闂達(dá)紝緲昏吘浜?jiǎn)涓涓?/span> 鐨勬簮浠g爜錛屽氨鏈変簡(jiǎn)榪欎竴緋誨垪鐨勪笢瑗匡紝鍏ㄥ綋鏄晠鍦伴噸娓鎬簡(jiǎn)涓鐣傝█褰掓浼犲惂銆傛枃绔犱腑鎵鏈夌殑浠g爜閮芥彁鍙栬嚜MFC 7.0


鍦∕FC涓紝RTTI鏄緷闈犱負(fù)褰兼鏈夌戶鎵垮叧緋葷殑綾誨緩绔嬩竴涓褰曞叾綾誨瀷鐨勯摼琛ㄦ潵瀹炵幇鐨勶紝鍜孯TTI鏈夊叧鐨凜RuntimeClass鎴愬憳鏈?涓細(xì)
LPCSTR聽(tīng)m_lpszClassName;聽(tīng)聽(tīng)聽(tīng)聽(tīng)//聽(tīng)鐢ㄤ簬璁板綍綾誨悕
//聽(tīng)鐢ㄤ簬鎸囧悜鍩虹被鐨凜RuntimeClass緇撴瀯
CRuntimeClass*聽(tīng)m_pBaseClass;聽(tīng)聽(tīng)
//聽(tīng)鐢ㄤ簬鎸囧悜閾捐〃涓墠涓涓被鐨凜RuntimeClass緇撴瀯
CRuntimeClass*聽(tīng)m_pNextClass;
//聽(tīng)鐢ㄤ簬寤虹珛綾誨埆鍨嬪綍
const聽(tīng)AFX_CLASSINIT*聽(tīng)m_pClassInit;聽(tīng)

榪欐牱鍦ㄨ繖涓被鍒瀷褰曚腑灝辨湁浜?jiǎn)璁稿鏉¤矾寰勫Q屾瘡涓鏉¢兘鏄部鐫m_pBaseClass涓鐩村彲浠ユ壘鍒版煇涓被鐨勬渶緇堝熀綾匯傝鎶婁竴涓被鍔犲叆鍒拌繖涓被鍒瀷褰曚腑瑕佺敤鍒頒袱涓畯錛?br />DECLARE_DYNAMIC聽(tīng)/聽(tīng)I(yíng)MPLEMENT_DYNAMIC
鍏朵腑錛?br />
#define聽(tīng)DECLARE_DYNAMIC聽(tīng)(class_name)聽(tīng)\
public:聽(tīng)\
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
static聽(tīng)const聽(tīng)CRuntimeClass聽(tīng)class##class_name;聽(tīng)\
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
virtual聽(tīng)CRuntimeClass*聽(tīng)GetRuntimeClass()聽(tīng)const;聽(tīng)\

榪欎釜瀹忔槸鐢ㄥ湪綾誨0鏄庝腑鐨勶紝鍏朵綔鐢ㄥ氨鏄牴鎹被鐨勫悕瀛椾負(fù)璇ョ被娣誨姞涓や釜public鐨勬垚鍛橈紝鍒嗗埆鐢ㄤ簬璁板綍綾葷殑鍨嬪埆鍜岃幏寰楀璞lass##class_name鐨勫湴鍧錛屾敞鎰忚繖閲岀殑class##class_name鏄釜闈?rùn)鎬佹垚鍛橈紝榪欏氨涓哄悗闈㈡垜浠仛綾誨瀷鐨勬瘮杈冨瀹氫簡(jiǎn)鍩虹錛堢戶鎵夸簬鍚屼竴涓熀綾葷殑媧劇敓綾誨璞″寘鍚叡鍚岀殑闈?rùn)鎬佺被鎴愬憳錛夈傚湪綾諱腑浣跨敤浜?jiǎn)DECLARE_DYNAMIC鍚庯紝榪樿鍦?cpp鐨勬枃浠朵腑浣跨敤IMPLEMENT_DYNAMIC瀹忥紝璇ュ畯鐨勪綔鐢ㄥ氨鏄垵濮嬪寲class##class_name瀵硅薄鍜屽畾涔塆etRuntimeClass鍑芥暟銆?br />
#define聽(tīng)I(yíng)MPLEMENT_DYNAMIC聽(tīng)(class_name,聽(tīng)base_class_name)聽(tīng)\
聽(tīng)聽(tīng)聽(tīng)聽(tīng)I(yíng)MPLEMENT_RUNTIMECLASS聽(tīng)(class_name,聽(tīng)base_class_name,聽(tīng)
0xFFFF,聽(tīng)NULL,聽(tīng)NULL)

IMPLEMENT_DYNAMIC鍦ㄤ嬌鐢ㄧ殑鏃跺欙紝瑕佹寚瀹氱被鍜屽叾鍩虹被鐨勫悕瀛楋紝涔嬪悗鍒╃敤IMPLEMENT_RUNTIMECLASS榪涜瀹炶川鎬х殑鍒濆鍖栨椿鍔ㄣ?br />
#define聽(tīng)I(yíng)MPLEMENT_RUNTIMECLASS聽(tīng)(class_name,聽(tīng)base_class_name,聽(tīng)wSchema,聽(tīng)pfnNew,聽(tīng)class_init)聽(tīng)\
聽(tīng)聽(tīng)聽(tīng)聽(tīng)AFX_COMDAT聽(tīng)
const聽(tīng)CRuntimeClass聽(tīng)class_name::class##class_name聽(tīng)=聽(tīng){聽(tīng)\
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)銆銆#class_name,聽(tīng)
sizeof(class聽(tīng)class_name),聽(tīng)wSchema,聽(tīng)pfnNew,聽(tīng)\
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)銆銆RUNTIME_CLASS(base_class_name),聽(tīng)NULL,聽(tīng)class_init聽(tīng)}
;聽(tīng)\

聽(tīng)聽(tīng)聽(tīng)聽(tīng)CRuntimeClass
*聽(tīng)class_name::GetRuntimeClass()聽(tīng)const聽(tīng)\
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
{聽(tīng)return聽(tīng)RUNTIME_CLASS聽(tīng)(class_name);聽(tīng)}聽(tīng)\

鍏朵腑錛屽湪class#class_name鐨勫垵濮嬪寲涓拰RTTI鐩稿叧鐨勫彧鏈夛細(xì)
&name_class鐢ㄦ潵鍒濆鍖杕_lpszClassName
RUNTIME_CLASS(base_class_name)鐢ㄦ潵鍒濆鍖朇RuntimeClass* m_pBaseClass
NULL鐢ㄦ潵鍒濆鍖朇RuntimeClass* m_pNextClass錛堟鏃剁被鍒瀷褰曡繕娌℃湁寤虹珛璧鋒潵錛?

鍙﹀錛孯UNTIME_CLASS灝辨槸鐢ㄦ潵鑾峰緱class##class_name瀵硅薄鍦板潃鐨勫畯錛?br />

#define聽(tīng)RUNTIME_CLASS聽(tīng)(class_name)聽(tīng)_RUNTIME_CLASS聽(tīng)(class_name)
#define聽(tīng)_RUNTIME_CLASS聽(tīng)(class_name)聽(tīng)\
聽(tīng)聽(tīng)聽(tīng)聽(tīng)((CRuntimeClass
*)聽(tīng)(&class_name::class##class_name))

榪欐牱錛屽綋瀵圭▼搴忎腑鐨勬瘡涓涓被閮戒嬌鐢ㄤ簡(jiǎn)DECLARE_DYNAMIC / IMPLEMENT_DYNAMIC瀹忎箣鍚庯紝灝變負(fù)璇ョ被鍦ㄧ被鍒瀷褰曚腑榪涜浜?jiǎn)鐧昏宸ヤ綔銆傚綋鐒?dòng)灱孧FC涓墍鏈夌殑綾婚兘媧劇敓浜嶤Object錛屾墍浠ユ墍鏈夌殑璺嚎鏈緇堥兘瑕佸湪CObject澶勪細(xì)鍚堬紝鐢變簬CObject娌℃湁鍩虹被錛屾墍浠ュ畠鐨凜RuntimeClass瀵硅薄騫朵笉鑳界敤涓婇潰鐨勪袱涓畯鏉ュ疄鐜幫紝鍦╫bjcore.cpp涓紝涓篊Object鐨刢lassCObject瀵硅薄鍗曠嫭浣滀簡(jiǎn)鍒濆鍖栫殑宸ヤ綔錛?/p>

const聽(tīng)struct聽(tīng)CRuntimeClass聽(tīng)CObject::classCObject聽(tīng)=
聽(tīng)
{聽(tīng)"CObject",聽(tīng)sizeof(CObject),聽(tīng)0xffff,聽(tīng)NULL,聽(tīng)NULL,聽(tīng)NULL聽(tīng)};

鎴戜滑鍙互鐪嬪埌m_pBaseClass琚垵濮嬪寲涓篘ULL銆傚彟澶栵紝涔熷崟鐙疄鐜頒簡(jiǎn)GetRuntimeClass():

CRuntimeClass*聽(tīng)CObject::GetRuntimeClass()聽(tīng)const聽(tīng){
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
return聽(tīng)_RUNTIME_CLASS聽(tīng)(CObject);
}

鑷充簬_RUNTIME_CLASS錛屽墠闈㈠凡緇忚榪囦簡(jiǎn)銆傝繖鏍鳳紝濡傛灉鎯寵鎶婅嚜宸辯殑綾諱粙緇嶇粰MFC錛屽彧瑕佸湪綾誨0鏄庝腑浣跨敤DECLARE_DYNAMIC錛屽湪綾葷殑瀹炵幇涓姞鍏MPLEMENT_DYNAMIC
錛屽氨鍙互鎶婅嚜宸辨敞鍐屽埌綾誨埆鍨嬪綍涓簡(jiǎn)銆傝嚦姝わ紝涓轟簡(jiǎn)瀹炵幇綾誨璞$殑RTTI錛屾垜浠凡緇忓仛濂戒簡(jiǎn)鎵鏈夌殑鍑嗗宸ヤ綔錛屼笅闈㈠氨鏉ョ湅涓涓嬪畠鐨勫疄鐜幫紝瀹冧富瑕佹槸闈燙Object涓殑IsKindOf鍑芥暟瀹屾垚鐨勩?/p>

BOOL聽(tīng)CObject::IsKindOf(const聽(tīng)CRuntimeClass*聽(tīng)pClass)聽(tīng)const
{
聽(tīng)銆銆
//聽(tīng)涓轟簡(jiǎn)綆媧侊紝鐣ュ幓浜?jiǎn)涓嶇浉鍏崇殑浠g?/span>
聽(tīng)銆銆CRuntimeClass*聽(tīng)pClassThis聽(tīng)=聽(tīng)GetRuntimeClass();
聽(tīng)銆銆
return聽(tīng)pClassThis->IsDerivedFrom(pClass);
}

榪欓噷錛岀敱浜嶨etRuntimeClass鏄櫄鍑芥暟錛屾墍浠ClassThis浼?xì)鎸囧悜璋冪敤IsKindOf鍑芥暟鐨勭被瀵硅薄鐨刢lass##class_name錛屼箣鍚庡埄鐢ㄦ寚鍚戣瀵硅薄鐨勬寚閽堣皟鐢↖sDerivedFrom錛?/p>

BOOL聽(tīng)CRuntimeClass::IsDerivedFrom(const聽(tīng)CRuntimeClass*聽(tīng)pBaseClass)聽(tīng)const聽(tīng){
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//涓轟簡(jiǎn)綆媧侊紝鐣ュ幓浜?jiǎn)涓嶇浉鍏崇殑浠g?/span>
聽(tīng)聽(tīng)聽(tīng)聽(tīng)if聽(tīng)(pBaseClass聽(tīng)==聽(tīng)NULL)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
return聽(tīng)FALSE;

聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//聽(tīng)simple聽(tīng)SI聽(tīng)case
聽(tīng)聽(tīng)聽(tīng)聽(tīng)const聽(tīng)CRuntimeClass*聽(tīng)pClassThis聽(tīng)=聽(tīng)this;
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
while聽(tīng)(pClassThis聽(tīng)!=聽(tīng)NULL)聽(tīng){
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
if聽(tīng)(pClassThis聽(tīng)==聽(tīng)pBaseClass)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)銆
return聽(tīng)TRUE;
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)pClassThis聽(tīng)
=聽(tīng)pClassThis->m_pBaseClass;
聽(tīng)聽(tīng)聽(tīng)聽(tīng)}
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
return聽(tīng)FALSE;聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)//聽(tīng)walked聽(tīng)to聽(tīng)the聽(tīng)top,聽(tīng)no聽(tīng)match
}

鎴戜滑鐭ラ亾錛屾淳鐢熺被鍜屽熀綾誨叡浜熀綾葷殑static瀵硅薄錛屾墍浠ュ湪榪欓噷錛屾淳鐢熺被鍜屽熀綾諱竴瀹氬叡浜浉鍚岀殑class##class_name瀵硅薄錛岃繖灝變負(fù)鎴戜滑鍒ゅ畾涓や釜綾繪槸鍚︽湁緇ф壙鍏崇郴鎻愪緵浜?jiǎn)鐞嗚鍩杭媭錛屽悓鏍鳳紝鍦↖sDerivedFrom涓紝while寰幆涓殑if涔熺殑紜槸榪欐牱鍋氱殑錛屽畠娌跨潃璇ョ被鐨勫悓瀹楄礬綰夸笂琛岋紝鍙涓嶅埌鍏卞悓鐨勭鍏圕Object錛屽氨鍐充笉緗紤銆傘

緇撹
濡傛灉鎯寵鎶婅嚜宸辯殑綾諱粙緇嶇粰MFC錛屽彧瑕佸湪綾誨0鏄庝腑浣跨敤DECLARE_DYNAMIC錛屽湪綾葷殑瀹炵幇涓姞鍏MPLEMENT_DYNAMIC
錛屽氨鍙互鎶婅嚜宸辨敞鍐屽埌綾誨埆鍨嬪綍涓簡(jiǎn)銆傘銆錛堝緟緇︹︼級(jí)


nacci 2006-05-18 14:53 鍙戣〃璇勮
]]>
鍦ㄧ紪璇戞椂鍐沖畾綾誨瀷鐨勫彲緇ф壙鎬?/title><link>http://www.shnenglu.com/nacci/archive/2006/05/15/7200.html</link><dc:creator>nacci</dc:creator><author>nacci</author><pubDate>Mon, 15 May 2006 09:20:00 GMT</pubDate><guid>http://www.shnenglu.com/nacci/archive/2006/05/15/7200.html</guid><wfw:comment>http://www.shnenglu.com/nacci/comments/7200.html</wfw:comment><comments>http://www.shnenglu.com/nacci/archive/2006/05/15/7200.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/nacci/comments/commentRss/7200.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/nacci/services/trackbacks/7200.html</trackback:ping><description><![CDATA[ <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 鏂板畫(huà)浣?>涓孌礐++鐨勮涔︾瑪璁?br /><br /><em>緇欏畾浠繪剰<span lang="EN-US">2</span>涓被鍨?span lang="EN-US">U</span>鍜?span lang="EN-US">T</span>錛屼綘濡備綍鏉ョ‘瀹?span lang="EN-US">U</span>鏄惁緇ф壙浜?span lang="EN-US">T</span>鍛紵鍦ㄧ紪璇戞椂鍙戠幇涓や釜綾誨瀷鐨勮繖縐嶅叧緋誨浜庢硾鍨嬪簱鐨勪紭鍖栨槸鏋佷負(fù)閲嶈鐨勩傚湪娉涘瀷鍑芥暟涓紝濡傛灉鏌愪釜綾誨疄鐜頒簡(jiǎn)鐗瑰畾鐨勬帴鍙o紝浣犲彲浠ユ牴鎹繖縐嶅叧緋諱負(fù)鍏跺埄鐢ㄧ壒瀹氱殑浼樺寲綆楁硶銆傚彟澶栵紝濡傛灉鎴戜滑鍙互鍦ㄧ紪璇戞湡鍐沖畾<span lang="EN-US">2</span>涓被鐨勫叧緋伙紝鎴戜滑涔熷彲浠ヨ繙紱?span lang="EN-US">dynamic_cast</span>錛屼粠鑰岄伩鍏嶈繍琛屾椂鐨勬晥鐜囧紑閿銆?br /><span lang="EN-US"><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:p></o:p></span></em></span> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 鏂板畫(huà)浣?> <hr /> <br />鍦ㄧ潃鎵嬭В鍐寵繖涓棶棰樹(shù)箣鍓嶏紝鎴戜滑鍏堟潵鑰冭檻涓涓洿涓轟竴鑸殑闂銆傚亣璁炬垜浠湁<span lang="EN-US">2</span>涓換鎰忕被鍨?span lang="EN-US">U</span>鍜?span lang="EN-US">T</span>錛屽浣曠‘瀹?span lang="EN-US">T</span>鑳藉惁鑷姩杞崲鎴?span lang="EN-US">U</span>鍛紵<span lang="EN-US"><o:p></o:p></span></span> </p> <p> </p> <p> </p> <p> </p> <p> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 鏂板畫(huà)浣?>絳旀涔熻璁╀綘鏈変簺鎯婅錛屾垜浠彲浠ュ埄鐢╯izeof鏉ュ府蹇欍備綘鍙互鎶?span lang="EN-US">sizeof</span>鐢ㄥ湪浠諱綍澶嶆潅鐨勮〃杈懼紡涓婏紝<span lang="EN-US"> sizeof</span>鍙互榪斿洖榪欎釜琛ㄨ揪寮忓肩殑澶у皬錛岃屼笉浼?xì)鍦q愯鏃惰瘎浼拌〃杈懼紡鐨勫箋傝繖涔熷氨鎰忓懗鐫錛屼綘鍙互鎶婂嚱鏁伴噸杞姐佹ā鐗堝疄渚嬪寲銆佽漿鎹㈣鍒欑瓑絳夋墍鏈変綘鍙互鍦?span lang="EN-US">C++</span>琛ㄨ揪寮忎腑浣跨敤鐨勮鏂界粺緇熷鍒?span lang="EN-US">sizeof</span>涓潵銆傚疄闄呬笂錛?span lang="EN-US">sizeof</span>闅愯棌浜?jiǎn)涓涓彲浠ユ紨緇庤〃杈懼紡綾誨瀷鐨勮鏂斤紝鏈緇堬紝<span lang="EN-US">sizeof</span>浼?xì)杩斿洖琛ㄨ緫旨従l撴灉鐨勭被鍨嬨?span lang="EN-US"><o:p></o:p></span></span> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 鏂板畫(huà)浣?>榪欐牱鎴戜滑灝卞彲浠ラ氳繃<span lang="EN-US">sizeof</span>鍜岄噸杞藉嚱鏁版潵瑙e喅鍒ゆ柇綾誨瀷涔嬮棿鐨勫彲杞崲鎬х殑闂銆傛濊礬寰堢畝鍗曪細(xì)鎴戜滑鎻愪緵<span lang="EN-US">2</span>涓噸杞藉嚱鏁幫紝涓涓嚱鏁扮殑鍙傛暟鏄垜浠杞崲鎴愮殑綾誨瀷錛堟垜浠敤<span lang="EN-US">U</span>琛ㄧず錛夛紝鑰屽彟涓涓垯鐢ㄦ潵鎺ユ敹鍏朵粬鎵鏈夌被鍨嬬殑鍙傛暟銆傜劧鍚庢垜浠妸瑕佹嫻嬬殑綾誨瀷錛堢敤<span lang="EN-US">T</span>琛ㄧず錛変紶閫掔粰閲嶈澆鍑芥暟銆傚鏋滄帴鍙楃被鍨?span lang="EN-US">U</span>涓哄弬鏁扮殑鍑芥暟琚皟鐢ㄤ簡(jiǎn)錛屾垜浠氨璁や負(fù)<span lang="EN-US">T</span>鍙互杞崲涓?span lang="EN-US">U</span>錛屽弽涔嬪垯涓嶅彲浠ャ傚浣曠‘瀹氬摢涓嚱鏁拌璋冪敤浜?jiǎn)鍛㈠Q熸垜浠埄鐢?span lang="EN-US">sizeof</span>鍑洪┈錛屾垜浠彧瑕佽閲嶈澆鍑芥暟榪斿洖涓嶅悓鐨勭被鍨嬶紝鐒跺悗媯(gè)鏌ヤ竴涓嬭繑鍥炲煎氨鍙互浜?jiǎn)銆?span lang="EN-US"><o:p></o:p></span></span> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 鏂板畫(huà)浣?>瀹炶返涓涓嬶細(xì)<span lang="EN-US"><o:p></o:p></span></span> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 鏂板畫(huà)浣?>棣栧厛錛屽畾涔?span lang="EN-US">2</span>涓笉鍚岀殑綾誨瀷錛?span lang="EN-US"><o:p></o:p></span></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> </span> </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">typedef聽(tīng)</span> <span style="COLOR: #0000ff">char</span> <span style="COLOR: #000000">聽(tīng)Small;<br /><img id="Codehighlighter1_30_47_Open_Image" onclick="this.style.display='none'; Codehighlighter1_30_47_Open_Text.style.display='none'; Codehighlighter1_30_47_Closed_Image.style.display='inline'; Codehighlighter1_30_47_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_30_47_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_30_47_Closed_Text.style.display='none'; Codehighlighter1_30_47_Open_Image.style.display='inline'; Codehighlighter1_30_47_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)Big聽(tīng)</span> <span id="Codehighlighter1_30_47_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_30_47_Open_Text"> <span style="COLOR: #000000">{聽(tīng)</span> <span style="COLOR: #0000ff">char</span> <span style="COLOR: #000000">聽(tīng)dummy[</span> <span style="COLOR: #000000">2</span> <span style="COLOR: #000000">];聽(tīng)}</span> </span> <span style="COLOR: #000000">;<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" /></span> </div> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">榛樿鎯呭喌涓嬶紝</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">sizeof(Small)</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鏄?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">1</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">錛岃?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Big</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐨勫ぇ灝忓垯鏃犲叧绱ц錛屾垜浠彧瑕佺煡閬撹偗瀹氫笉鏄?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">1</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">灝卞ソ浜?jiǎn)銆?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鍏舵錛屽畾涔?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">2</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">涓噸杞藉嚱鏁幫紝涓涓帴鏀惰杞崲鎴愮殑綾誨瀷錛?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Small Test(U);<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鍙︿竴涓敤鏉ユ帴鏀垛滃叾浠栫殑鎵鏈夌被鍨嬧濓紝鎴戜滑瑕佷繚璇佸湪鎺掗櫎鎵鏈夌殑杞崲涔嬪悗鎵嶈皟鐢ㄨ繖涓嚱鏁幫紝</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">OK,</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐢ㄧ渷鐣ュ彿琛ㄧず鐨勫弬鏁板垪琛ㄧ湡濂芥弧瓚抽渶姹?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Big Test(...);<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <i style="mso-bidi-font-style: normal"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">灝界鎶婁竴涓?/span> </i> <i style="mso-bidi-font-style: normal"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">C++</span> </i> <i style="mso-bidi-font-style: normal"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">瀵硅薄浼犻掔粰</span> </i> <i style="mso-bidi-font-style: normal"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">...</span> </i> <i style="mso-bidi-font-style: normal"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鍙傛暟綾誨瀷鐨勫嚱鏁幫紝鍏剁粨鏋滄湭瀹氫箟錛屼絾鏄疄闄呬笂鎴戜滑騫舵病鏈夎皟鐢ㄨ繖涓嚱鏁般傛垜浠敋鑷沖彲浠ヤ笉鐢ㄥ疄鐜板畠銆?/span> </i> <i style="mso-bidi-font-style: normal"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </i> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">鏈鍚庯紝鎴戜滑鐢?/span> <span lang="EN-US" style="mso-font-kerning: 0pt; mso-no-proof: yes">sizeof</span> <span style="FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-font-kerning: 0pt; mso-no-proof: yes">鍒ゆ柇涓涓嬪氨瀹屾垚浠誨姟浜?jiǎn)锛?xì)</span> <span lang="EN-US" style="mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> </span> </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: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">bool</span> <span style="COLOR: #000000">聽(tīng)convExist聽(tīng)</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">sizeof</span> <span style="COLOR: #000000">(Test(T()))聽(tīng)</span> <span style="COLOR: #000000">==</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">sizeof</span> <span style="COLOR: #000000">(Small);<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" /></span> </div> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">浣犱篃璁鎬細(xì)璇達(dá)紝灝辨槸瀹冧簡(jiǎn)錛?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Test</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐨勮皟鐢ㄤ細(xì)鍒涘緩涓涓復(fù)鏃跺璞?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">錛屼箣鍚庡彲鑳界殑緇撴灉鍙兘鏄?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">sizeof(Small)</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鎴?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">sizeof(Big)</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">銆傚叴濂嬩箣浣欙紝鎴戜滑榪樿鐪嬪埌涓涓棶棰樸傚鏋?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐨勬瀯閫犲嚱鏁拌璁捐鎴?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">private</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">錛屾垜浠氨鍓嶅姛灝藉純浜?jiǎn)銆傚綋鐒惰В鍐崇殑鏂規(guī)硶涔熷緢綆鍗曪紝瀹氫箟涓涓嚱鏁幫紝璁╀粬榪斿洖綾誨瀷涓?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐨勫璞°?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> </span> </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">T聽(tīng)MakeT();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">bool</span> <span style="COLOR: #000000">聽(tīng)convExist聽(tīng)</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">sizeof</span> <span style="COLOR: #000000">(Test(MakeT()))聽(tīng)</span> <span style="COLOR: #000000">==</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">sizeof</span> <span style="COLOR: #000000">(Small);<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" /></span> </div> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鏈鍚庯紝鎶婂垰鎵嶇殑涓滆タ灝佽鍒頒竴涓被閲岋細(xì)</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> </span> </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聽(tīng)</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)T,聽(tīng)</span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)U</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_45_250_Open_Image" onclick="this.style.display='none'; Codehighlighter1_45_250_Open_Text.style.display='none'; Codehighlighter1_45_250_Closed_Image.style.display='inline'; Codehighlighter1_45_250_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_45_250_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_45_250_Closed_Text.style.display='none'; Codehighlighter1_45_250_Open_Image.style.display='inline'; Codehighlighter1_45_250_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)Conversion聽(tīng)</span> <span id="Codehighlighter1_45_250_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_45_250_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)typedef聽(tīng)</span> <span style="COLOR: #0000ff">char</span> <span style="COLOR: #000000">聽(tīng)Small;<br /><img id="Codehighlighter1_85_102_Open_Image" onclick="this.style.display='none'; Codehighlighter1_85_102_Open_Text.style.display='none'; Codehighlighter1_85_102_Closed_Image.style.display='inline'; Codehighlighter1_85_102_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_85_102_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_85_102_Closed_Text.style.display='none'; Codehighlighter1_85_102_Open_Image.style.display='inline'; Codehighlighter1_85_102_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)Big聽(tīng)</span> <span id="Codehighlighter1_85_102_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_85_102_Open_Text"> <span style="COLOR: #000000">{聽(tīng)</span> <span style="COLOR: #0000ff">char</span> <span style="COLOR: #000000">聽(tīng)dummy[</span> <span style="COLOR: #000000">2</span> <span style="COLOR: #000000">];聽(tīng)}</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" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">static</span> <span style="COLOR: #000000">聽(tīng)Small聽(tīng)Test(U);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">static</span> <span style="COLOR: #000000">聽(tīng)Big聽(tīng)Test(<img src="http://www.shnenglu.com/images/dot.gif" />);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">static</span> <span style="COLOR: #000000">聽(tīng)T聽(tīng)MakeT();<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">public</span> <span style="COLOR: #000000">:<br /><img id="Codehighlighter1_198_247_Open_Image" onclick="this.style.display='none'; Codehighlighter1_198_247_Open_Text.style.display='none'; Codehighlighter1_198_247_Closed_Image.style.display='inline'; Codehighlighter1_198_247_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_198_247_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_198_247_Closed_Text.style.display='none'; Codehighlighter1_198_247_Open_Image.style.display='inline'; Codehighlighter1_198_247_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">enum</span> <span style="COLOR: #000000">聽(tīng)</span> <span id="Codehighlighter1_198_247_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_198_247_Open_Text"> <span style="COLOR: #000000">{聽(tīng)exist聽(tīng)</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">sizeof</span> <span style="COLOR: #000000">(Test(MakeT()))聽(tīng)</span> <span style="COLOR: #000000">==</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">sizeof</span> <span style="COLOR: #000000">(Small)聽(tīng)}</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">;<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" /></span> </div> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鍙﹀錛屾垜浠繕鍙互璁劇疆鍙﹀涓涓父閲?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Conversion::SameType</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">錛屽鏋?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鍜?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">U</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">琛ㄧず鍚屼竴涓被鍨嬶紝閭d箞榪斿洖</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">true</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">錛?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> </span> </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聽(tīng)</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)T,聽(tīng)</span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)U</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_45_94_Open_Image" onclick="this.style.display='none'; Codehighlighter1_45_94_Open_Text.style.display='none'; Codehighlighter1_45_94_Closed_Image.style.display='inline'; Codehighlighter1_45_94_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_45_94_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_45_94_Closed_Text.style.display='none'; Codehighlighter1_45_94_Open_Image.style.display='inline'; Codehighlighter1_45_94_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)Conversion聽(tīng)</span> <span id="Codehighlighter1_45_94_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_45_94_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)..聽(tīng)</span> <span style="COLOR: #0000ff">as</span> <span style="COLOR: #000000">聽(tīng)above..<br /><img id="Codehighlighter1_74_92_Open_Image" onclick="this.style.display='none'; Codehighlighter1_74_92_Open_Text.style.display='none'; Codehighlighter1_74_92_Closed_Image.style.display='inline'; Codehighlighter1_74_92_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_74_92_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_74_92_Closed_Text.style.display='none'; Codehighlighter1_74_92_Open_Image.style.display='inline'; Codehighlighter1_74_92_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">enum</span> <span style="COLOR: #000000">聽(tīng)</span> <span id="Codehighlighter1_74_92_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_74_92_Open_Text"> <span style="COLOR: #000000">{聽(tīng)sameType聽(tīng)</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽(tīng)</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">;<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" /></span> </div> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">涔嬪悗涓哄悓涓涓被鍨嬭璁′竴涓亸鐗瑰寲鐗堟湰錛?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="FR" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-ansi-language: FR; mso-no-proof: yes"> </span> </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聽(tīng)</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)T</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_42_83_Open_Image" onclick="this.style.display='none'; Codehighlighter1_42_83_Open_Text.style.display='none'; Codehighlighter1_42_83_Closed_Image.style.display='inline'; Codehighlighter1_42_83_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_42_83_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_42_83_Closed_Text.style.display='none'; Codehighlighter1_42_83_Open_Image.style.display='inline'; Codehighlighter1_42_83_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)Conversion</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">T,聽(tīng)T</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">聽(tīng)</span> <span id="Codehighlighter1_42_83_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_42_83_Open_Text"> <span style="COLOR: #000000">{<br /><img id="Codehighlighter1_53_80_Open_Image" onclick="this.style.display='none'; Codehighlighter1_53_80_Open_Text.style.display='none'; Codehighlighter1_53_80_Closed_Image.style.display='inline'; Codehighlighter1_53_80_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_53_80_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_53_80_Closed_Text.style.display='none'; Codehighlighter1_53_80_Open_Image.style.display='inline'; Codehighlighter1_53_80_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">enum</span> <span style="COLOR: #000000">聽(tīng)</span> <span id="Codehighlighter1_53_80_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_53_80_Open_Text"> <span style="COLOR: #000000">{聽(tīng)exists聽(tīng)</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">,聽(tīng)sameType聽(tīng)</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">聽(tīng)}</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">;<br /></span> </div> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鏈鍚庯紝鍥炲埌鎴戜滑鐨勪富棰橈紝閫氳繃</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Conversion</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐨勫府鍔╋紝鎴戜滑鍙互鏉ュ喅瀹氫袱涓被鍨嬬殑緇ф壙鎬т簡(jiǎn)銆?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> </span> </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; HEIGHT: 66px; 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">聽(tīng)SUPERSUBCLASS(T,聽(tīng)U)聽(tīng)\</span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)(Conversion</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)U</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">,聽(tīng)</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)T</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">)::exists聽(tīng)</span> <span style="COLOR: #000000">&&</span> <span style="COLOR: #000000">聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</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īng)T</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">,聽(tīng)</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000">*></span> <span style="COLOR: #000000">::sameType)</span> </div> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">褰?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">U</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">緇ф壙浜?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鎴栬?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">U</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鍜?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鏄悓涓涓被鍨嬬殑鏃跺欙紝</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">SUPERSUBCLASS</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">榪斿洖</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">true</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">銆傛葷粨涓涓嬶紝鍙湁涓嬮潰榪?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">3</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">縐嶆儏褰?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">const U*</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鍙互闅愬紡杞崲鍒?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">const T*</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">錛?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-fareast-font-family: 'Lucida Console'; mso-no-proof: yes"> <span style="mso-list: Ignore">1.<span style="FONT: 7pt 'Times New Roman'">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span></span> </span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鍜?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">U</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鏄悓涓涓被鍨?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-fareast-font-family: 'Lucida Console'; mso-no-proof: yes"> <span style="mso-list: Ignore">2.<span style="FONT: 7pt 'Times New Roman'">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span></span> </span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鏄?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">U</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐨勪換鎰忎竴涓熀綾?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-bidi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-fareast-font-family: 'Lucida Console'; mso-no-proof: yes"> <span style="mso-list: Ignore">3.<span style="FONT: 7pt 'Times New Roman'">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span></span> </span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鏄?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">void<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鎴戜滑閫氳繃絎?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">2</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">涓祴璇曞睆钄戒簡(jiǎn)鏈鍚庝竴縐嶆儏褰€傚綋鐒?dòng)灱屽鏋滀綘璁や负鍚屼竴縐嶇被鍨嬩篃涓嶇畻鏄戶鎵垮叧緋葷殑璇濓紝鍙互榪涗竴姝ヤ弗鏍煎叾鏉′歡錛?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> </span> </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: #0000ff">#define</span> <span style="COLOR: #000000">聽(tīng)SUPERSUBCLASS_STRICT(T,聽(tīng)U)聽(tīng)\</span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)(SUPERSUBCLASS(T,聽(tīng)U)聽(tīng)</span> <span style="COLOR: #000000">&&</span> <span style="COLOR: #000000">聽(tīng)\<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #000000">!</span> <span style="COLOR: #000000">Conversion(</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)T,聽(tīng)</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)U)::sameType)</span> </div> <img src ="http://www.shnenglu.com/nacci/aggbug/7200.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/nacci/" target="_blank">nacci</a> 2006-05-15 17:20 <a href="http://www.shnenglu.com/nacci/archive/2006/05/15/7200.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>C++鐨勯潤(rùn)鎬佸垎媧炬妧鏈?/title><link>http://www.shnenglu.com/nacci/archive/2005/11/11/1058.html</link><dc:creator>nacci</dc:creator><author>nacci</author><pubDate>Fri, 11 Nov 2005 03:42:00 GMT</pubDate><guid>http://www.shnenglu.com/nacci/archive/2005/11/11/1058.html</guid><wfw:comment>http://www.shnenglu.com/nacci/comments/1058.html</wfw:comment><comments>http://www.shnenglu.com/nacci/archive/2005/11/11/1058.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/nacci/comments/commentRss/1058.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/nacci/services/trackbacks/1058.html</trackback:ping><description><![CDATA[ <div> <span lang="EN-US"> <font face="Times New Roman" size="2">鎴戜滑鍙互鐢ㄤ笉鍚岀殑鏁存暟鏉ュ疄渚嬪寲鍚屼竴涓ā鏉匡紝浠庤屾瀯閫犱笉鍚岀殑綾誨瀷錛岃繘鑰屽湪緙栬瘧鏈熸墽琛屾煇浜涙妷鎷┿?/font> </span> </div> <div> <font size="3"> <span lang="EN-US"> <font face="Times New Roman"> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> </p> <hr id="[object]" /> <p> </p> </font> </span> </font> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <font size="2"> <span lang="EN-US"> <font face="Times New Roman">Alexandrescu</font> </span> <span style="FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">鏈鍒濊璁$殑涓涓畝鍗曠殑妯$増錛岀幇鍦ㄦ垚浜?jiǎn)娉涘瀷璁捐鐨勫父鐢ㄦ墜娉曞Q?/span> </font> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">template</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"><<font face="Lucida Console"><span style="COLOR: blue">int</span> v><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?><o:p></o:p></font></span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">struct</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Int2Type {<o:p></o:p></span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: blue">enum</span> { value<span style="mso-spacerun: yes">聽(tīng) </span>= v };<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">};<o:p></o:p></span> </p> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">瀵逛簬姣忎竴涓笉鍚岀殑甯告暣鏁幫紝</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Int2Type</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">閮戒唬琛ㄤ笉鍚岀殑綾誨瀷銆傝繖鏄洜涓轟笉鍚岀殑妯$増瀹炰緥鍖栭兘浠h〃涓嶅悓鐨勭被鍨嬶紝涔熷氨鏄</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Int2Type<0></span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鍜?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Int2Type<1></span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鏄畬鍏ㄤ笉鍚岀殑銆?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">褰撲綘鎯蟲(chóng)牴鎹紪璇戞椂緇撴灉鏉ヨ繘琛屾煇浜涙妷鎷┾斺斾緥濡傞夋嫨涓嶅悓鐨勫嚱鏁扳斺旀椂錛屼綘鍙互渚濊禆涓涓父鏁存暟鏉ュ府浣犲畬鎴愬垎媧懼伐浣滐紝榪欐椂</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Int2Type</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">渚垮彲浠ュ府浣犳槸瀹炵幇榪欎釜鏂規(guī)硶銆?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">涓鑸潵璇達(dá)紝浣犲湪涓嬮潰涓や釜鎯呭喌涓渶瑕佷嬌鐢?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Int2Type</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">錛?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-font-kerning: 0pt; mso-fareast-font-family: Wingdings; mso-no-proof: yes"> <span style="mso-list: Ignore"> <font face="Wingdings">l</font> <span style="FONT: 7pt 'Times New Roman'">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span> </span> </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">浣犻渶瑕佹牴鎹紪璇戞椂甯擱噺鏉ヨ皟鐢ㄤ笉鍚岀殑鍑芥暟</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; mso-list: l0 level1 lfo1; tab-stops: list 21.0pt"> <span lang="EN-US" style="FONT-FAMILY: Wingdings; mso-bidi-font-family: Wingdings; mso-fareast-font-family: Wingdings"> <span style="mso-list: Ignore"> <font face="Wingdings" size="3">l</font> <span style="FONT: 7pt 'Times New Roman'">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span> </span> </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">浣犻渶瑕佸湪緙栬瘧鏃舵墽琛屽垎媧懼伐浣?/span> </p> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">濡傛灉鏄湪榪愯鏃舵墽琛屽垎媧懼伐浣滐紝浣犲彲浠ョ敤</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">if-else</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鎴?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">switch</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">璇彞鏉ョ畝鍗曠殑瀹炵幇銆傚湪澶ч儴鍒嗙殑鏃跺欙紝榪欑榪愯鏃舵垚鏈兘鏄井涓嶈凍閬撶殑銆備絾鏄紝鏈夋椂瀹冧滑鍗翠笉鑳芥弧瓚充綘鐨勮姹傘傛棦鏄槸鍦ㄧ紪璇戞湡鍙互鍐沖畾鍏跺垎鏀紝緙栬瘧鍣ㄨ繕鏄細(xì)鍕ゅ姵鐨勪負(fù)浣犵紪璇戝叾鎵鏈夌殑鍒嗘敮錛岃繖涔熷氨鎰忓懗鐫</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">if-else</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐨勬墍鏈夊垎鏀繀欏昏鎴愬姛緙栬瘧銆傛湁浜涘洶鎯戯紵緇х畫(huà)鐪嬩笅鍘伙細(xì)</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鑰冭檻涓嬮潰鐨勬儏褰細(xì)浣犺璁′簡(jiǎn)涓涓硾鍨嬪鍣?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">NiftyContainer</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">錛?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">template</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"><<font face="Lucida Console"><span style="COLOR: blue">class</span> T> <span style="COLOR: blue">class</span> NiftyContainer {<o:p></o:p></font></span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span>...<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">};<o:p></o:p></span> </p> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">浠?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">NiftyContainer</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">瀹瑰櫒鍖呭惈鎸囧悜</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">瀵硅薄鐨勬寚閽堛備負(fù)浜?jiǎn)澶嶅?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">NiftyContainer</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">涓殑涓涓璞★紝浣犲彲鑳介渶瑕佽皟鐢?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐨勬嫹璐濇瀯閫犲嚱鏁幫紙瀵逛簬闈炲鎬佺被鍨嬶級(jí)鎴栬呬竴涓悕涓?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Clone()</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐨勮櫄鍑芥暟錛堝浜庡鎬佺被鍨嬶級(jí)銆備綘鍙互閫氳繃璁劇疆涓涓?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">bool</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">綾誨瀷鐨勬ā鐗堝弬鏁版潵浠庣被鐨勫鎴鋒墜閲岃幏寰楀叧浜庡鎬佺殑淇℃伅銆?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: #d9d9d9; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">template</span> <span lang="EN-US" style="FONT-SIZE: 10pt; BACKGROUND: #d9d9d9; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"><<font face="Lucida Console"><span style="COLOR: blue">class</span> T, <span style="COLOR: blue">bool</span> isPolymorphic> <span style="COLOR: blue">class</span> NiftyContainer {</font></span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: green">// Other actions<o:p></o:p></span> </font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: blue">void</span> DoSomething() {<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 2">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span>T* pSomeObj = ...;<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 2">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: blue">if</span>(isPolymorphic) {<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 3">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span>T* pNewObj = pSomeObj->Clone();<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 3">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: green">// Some polymorphic algorithm<o:p></o:p></span> </font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 2">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span>}<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 2">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: blue">else</span> {<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 3">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span>T* pNewObj = <span style="COLOR: blue">new</span> T(*pSomeObj);<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 3">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: green">// Some non-polymorphic algorithm<o:p></o:p></span> </font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 2">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span>}<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span>}<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">};<o:p></o:p></span> </p> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">闂鍦ㄤ簬緙栬瘧鍣ㄤ笉浼?xì)璁╀綘淝o騫哥紪璇戜笂闈㈢殑浠g爜銆備緥濡傦紝濡傛灉涓涓鎬佺被鍨嬫病鏈夊畾涔?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Clone()</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">錛岄偅涔?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">NiftyContainer::DoSomething</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">緇濆涓嶄細(xì)閫氳繃緙栬瘧銆傚敖綆″湪緙栬瘧鏃舵垜浠偗瀹氬彲浠ュ浜庡垎鏀繘琛屽垽鏂紝浣嗚繖姣曠珶涓嶆槸緙栬瘧鍣ㄧ殑宸ヤ綔錛屼粬鍙細(xì)鍕ゅ姵鐨勪負(fù)浣犵紪璇戝嚭鎵鏈夌殑浠g爜銆備簬鏄綋浣犺瘯鍥捐皟鐢?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">NiftyContainer<int, false>::DoSomething</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐨勬椂鍊欙紝緙栬瘧鍣ㄨ繕鏄細(xì)鍋滃湪</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">pObj->Clone()</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">涓婏紝騫朵笖鎶辨ㄨ錛氣滀綘鍦ㄥ仛浠涔堬紵鈥?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">瀵逛簬闈炲鎬佺被鍨嬪垎鏀紝涔熸湁鍙兘鍙戠敓緙栬瘧閿欒銆傚鏋?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">T</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鏄竴涓鎬佺被鍨嬶紝騫朵笖鎶婂畠鐨勬嫹璐濇瀯閫犲嚱鏁拌瀹氫負(fù)</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">private</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鐨勬椂鍊欙紙榪欐椂涓涓鎬佺被鐨勮壇濂借涓猴級(jí)錛岄潪澶氭佸垎鏀殑</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">new T(*pObj)</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">灝變細(xì)鍙戠敓閿欒銆?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">浣犲彲鑳戒細(xì)鎯籌紝濡傛灉緙栬瘧鍣ㄥ彲浠ヤ笉鍘葷悊浼?xì)閭d簺涓嶅繀瑕佺殑鍒嗘敮灏卞ソ浜?jiǎn)錛屼絾鏄湅鏉ヤ笉澶彲鑳姐傞偅涔堬紝濡備綍鏄ソ鍛紵</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鍏跺疄錛屾柟娉曟湁寰堝錛?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Int2Type</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鎻愪緵浜?jiǎn)涓涓畝媧佺殑鍔炴硶銆傚畠鍙互鏍規(guī)嵁</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">true</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鍜?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">false</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鏉ョ敓鎴愪袱涓笉鍚岀殑綾誨瀷錛岃屽悗鏍規(guī)嵁</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Int2Type<isPolymorphic></span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">璇勪及姝g‘鐨勮皟鐢ㄣ?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">template</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"><<font face="Lucida Console"><span style="COLOR: blue">class</span> T, <span style="COLOR: blue">bool</span> isPolymorphic> <span style="COLOR: blue">class</span> NiftyContainer {<o:p></o:p></font></span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">private</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">:<o:p></o:p></span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: green">// Other actions<o:p></o:p></span> </font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: blue">void</span> DoSomething(T* pObj, Int2Type<<span style="COLOR: blue">true</span>>) {<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 2">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span>T* pNewObj = pSomeObj->Clone();<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 2">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: green">// Some polymorphic algorithm<o:p></o:p></span> </font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span>}<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: blue">void</span> DoSomething(T* pObj, Int2Type<<span style="COLOR: blue">false</span>>) {<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 2">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span>T* pNewObj = <span style="COLOR: blue">new</span> T(*pSomeObj);<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 2">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: green">// Some non-polymorphic algorithm<o:p></o:p></span> </font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span>}<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">public</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">:<o:p></o:p></span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span> <span style="COLOR: blue">void</span> DoSomething(T* pObj) {<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 2">聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) </span>DoSomething(pObj, Int2Type<isPolymorphic>());<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-layout-grid-align: none" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <font face="Lucida Console"> <span style="mso-tab-count: 1">聽(tīng)聽(tīng)聽(tīng) </span>}<o:p></o:p></font> </span> </p> <p style="BACKGROUND: #d9d9d9; MARGIN: 0cm 0cm 0pt"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">};<o:p></o:p></span> </p> <p style="MARGIN: 7.8pt 0cm; mso-para-margin-top: .5gd; mso-para-margin-right: 0cm; mso-para-margin-bottom: .5gd; mso-para-margin-left: 0cm"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">褰撲綘鎯蟲(chóng)妸甯告暣鏁扮敤浣滀竴涓被鍨嬬殑鏃跺欙紝</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">Int2Type</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹?huà)浣? mso-ascii-font-family: 'Lucida Console'; mso-hansi-font-family: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes">鏄潪甯告柟渚跨殑銆備綘鍙互浼犻掍竴涓復(fù)鏃剁殑鍙橀噺鏉ラ噸杞藉嚱鏁般傝屼箣鎵浠ユ垜浠彲浠ヨ繖鏍峰仛錛屾槸鍥犱負(fù)緙栬瘧鍣ㄤ笉浼?xì)鍘痪~栬瘧娌℃湁鐢ㄥ埌鐨勬ā鏉垮嚱鏁般?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Lucida Console'; mso-font-kerning: 0pt; mso-no-proof: yes"> <o:p> </o:p> </span> </p> </div> <img src ="http://www.shnenglu.com/nacci/aggbug/1058.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/nacci/" target="_blank">nacci</a> 2005-11-11 11:42 <a href="http://www.shnenglu.com/nacci/archive/2005/11/11/1058.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍙湪澶氭佸熀綾諱腑澹版槑铏氭瀽鏋勫嚱鏁?/title><link>http://www.shnenglu.com/nacci/archive/2005/11/10/1046.html</link><dc:creator>nacci</dc:creator><author>nacci</author><pubDate>Thu, 10 Nov 2005 08:43:00 GMT</pubDate><guid>http://www.shnenglu.com/nacci/archive/2005/11/10/1046.html</guid><wfw:comment>http://www.shnenglu.com/nacci/comments/1046.html</wfw:comment><comments>http://www.shnenglu.com/nacci/archive/2005/11/10/1046.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.shnenglu.com/nacci/comments/commentRss/1046.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/nacci/services/trackbacks/1046.html</trackback:ping><description><![CDATA[     鎽樿: 鍏充簬virtual desctructor鐨勮緇嗚璁恒傚悓鏍鋒潵鑷簬銆奅ffective C++銆?rd Edition銆? 璺熻釜鏃墮棿鏄緢騫沖父鐨勪換鍔★紝鎵浠ュ紑鍙戜竴涓悕涓? TimeKeeper 鐨勫熀綾伙紝騫惰涓嶅悓鐨勬淳鐢熺被鏉ュ疄鐜頒笉鍚岀殑璁℃椂鏂規(guī)硶鏄緢鍚堢悊鐨勪簨鎯咃細(xì) ...  <a href='http://www.shnenglu.com/nacci/archive/2005/11/10/1046.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/nacci/aggbug/1046.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/nacci/" target="_blank">nacci</a> 2005-11-10 16:43 <a href="http://www.shnenglu.com/nacci/archive/2005/11/10/1046.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>嫻呮瀽C++ Compile-time Assertion鎶鏈?/title><link>http://www.shnenglu.com/nacci/archive/2005/11/07/969.html</link><dc:creator>nacci</dc:creator><author>nacci</author><pubDate>Mon, 07 Nov 2005 15:10:00 GMT</pubDate><guid>http://www.shnenglu.com/nacci/archive/2005/11/07/969.html</guid><wfw:comment>http://www.shnenglu.com/nacci/comments/969.html</wfw:comment><comments>http://www.shnenglu.com/nacci/archive/2005/11/07/969.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.shnenglu.com/nacci/comments/commentRss/969.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/nacci/services/trackbacks/969.html</trackback:ping><description><![CDATA[     鎽樿: 浣犲彲鑳界粡甯擱渶瑕佸埄鐢ㄨ繍琛屾椂鏂█鎶鏈紝瀹冨彲浠ユ柟渚垮湴嫻嬭瘯鍓嶆彁鏉′歡銆備絾鏄紝闅忕潃Metaprogramming姒傚康鐨勫嚭鐜幫紝緙栬瘧鏃舵柇璦鎶鏈篃宸茬粡鍜宺untime assertion涓鏍風(fēng)殑鏅亶浜?jiǎn)銆傚浣曞湪緙栬瘧鏃惰繘琛屾柇璦鍛紵鍏跺疄錛屾柟娉曞彧鏈変竴涓紝灝辨槸璁╃紪璇戝櫒鐢熸垚涓鏉¢敊璇俊鎭紝浣嗘槸緙栬瘧鍣ㄧ敓鎴愮殑閿欒淇℃伅淇℃伅鎬у線寰鏈夊張鐞嗘兂銆傚茍涓旓紝鍗充嬌浣犲湪涓縐嶇紪璇戜笂璁捐浜?jiǎn)涓縐嶆柟妗堬紝浣犱篃寰堥毦鎶婂畠縐繪鍒板叾浠栫殑緙栬瘧鍣ㄤ笂銆傛垜浠氳繃鍏跺疄鐜版柟娉曠殑鏀硅繘鍜?..  <a href='http://www.shnenglu.com/nacci/archive/2005/11/07/969.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/nacci/aggbug/969.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/nacci/" target="_blank">nacci</a> 2005-11-07 23:10 <a href="http://www.shnenglu.com/nacci/archive/2005/11/07/969.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>C++鐨勭被鍨嬭悆鍙栨妧鏈?/title><link>http://www.shnenglu.com/nacci/archive/2005/11/03/911.html</link><dc:creator>nacci</dc:creator><author>nacci</author><pubDate>Thu, 03 Nov 2005 02:03:00 GMT</pubDate><guid>http://www.shnenglu.com/nacci/archive/2005/11/03/911.html</guid><wfw:comment>http://www.shnenglu.com/nacci/comments/911.html</wfw:comment><comments>http://www.shnenglu.com/nacci/archive/2005/11/03/911.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/nacci/comments/commentRss/911.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/nacci/services/trackbacks/911.html</trackback:ping><description><![CDATA[     鎽樿: 鑷粠C++涓紩鍏ヤ簡(jiǎn)template鍚庯紝浠ユ硾鍨嬫妧鏈負(fù)涓績(jī)鐨勮璁″緱鍒頒簡(jiǎn)闀胯凍鐨勮繘姝ャ係TL灝辨槸榪欎釜闃舵鏉板嚭鐨勪駭鐗┿係TL鐨勭洰鏍囧氨鏄鎶婃暟鎹拰綆楁硶鍒嗗紑錛屽垎鍒鍏惰繘琛岃璁★紝涔嬪悗閫氳繃涓縐嶅悕涓篿terator鐨勪笢瑗匡紝鎶婅繖浜岃呭啀綺樻帴鍒頒竴璧楓傝璁℃ā寮忎腑錛屽叧浜巌terator鐨勬弿榪頒負(fù)錛氫竴縐嶈兘澶熼『搴忚闂鍣ㄤ腑姣忎釜鍏冪礌鐨勬柟娉曪紝浣跨敤璇ユ柟娉曚笉鑳芥毚闇插鍣ㄥ唴閮ㄧ殑琛ㄨ揪鏂瑰紡銆傚彲浠ヨ錛岀被鍨嬭悆鍙栨妧鏈氨鏄負(fù)浜?jiǎn)瑕佽В鍐冲拰iterator鏈夊叧鐨?..  <a href='http://www.shnenglu.com/nacci/archive/2005/11/03/911.html'>闃呰鍏ㄦ枃</a><img src ="http://www.shnenglu.com/nacci/aggbug/911.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/nacci/" target="_blank">nacci</a> 2005-11-03 10:03 <a href="http://www.shnenglu.com/nacci/archive/2005/11/03/911.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>C++榛樿浼?xì)湄?fù)鎴戜滑鍋氫簺浠涔堝伐浣滐紵http://www.shnenglu.com/nacci/archive/2005/11/03/910.htmlnaccinacciThu, 03 Nov 2005 01:17:00 GMThttp://www.shnenglu.com/nacci/archive/2005/11/03/910.htmlhttp://www.shnenglu.com/nacci/comments/910.htmlhttp://www.shnenglu.com/nacci/archive/2005/11/03/910.html#Feedback2http://www.shnenglu.com/nacci/comments/commentRss/910.htmlhttp://www.shnenglu.com/nacci/services/trackbacks/910.html

class涓嶆槸絀虹殑錛?span lang="EN-US">C++浼?xì)鍦ㄤ綍鏃跺仛浜涗粈涔堜簨鎯咃紵濡傛灉浣犱笉澹版槑瀹冧滑錛岀紪璇戝櫒浼?xì)湄?fù)浣犲0鏄庡畠浠嚜宸辯殑鎷瘋礉鏋勯犲嚱鏁般佷竴涓祴鍊艱繍綆楃鍜屼竴涓瀽鏋勫嚱鏁般傚彟澶栵紝濡傛灉浣犱笉澹版槑涓涓瀯閫犲嚱鏁幫紝緙栬瘧鍣ㄨ繕?shù)細(xì)湄?fù)浣犲垱寤轟竴涓傛墍鏈夎繖浜涜嚜鍔ㄧ敓鎴愮殑鍑芥暟閮芥槸public鍜?span lang="EN-US">inline鐨勩備緥濡傦紝濡傛灉浣犲啓涓嬶細(xì)

class Empty {};

榪欏拰浣犲啓涓嬪涓嬬殑浠g爜鏈川涓婃槸涓鏍風(fēng)殑錛?/span>

class Empty {

聽(tīng)聽(tīng)聽(tīng) Empty() {鈥 // default constructor

聽(tīng)聽(tīng)聽(tīng) Empty(const Empty& rhs) {鈥 // Copy constructor

聽(tīng)聽(tīng)聽(tīng) ~Empty() {鈥聽(tīng) // destructor - whether it's virtual?

聽(tīng)聽(tīng)聽(tīng)

聽(tīng)聽(tīng)聽(tīng) // copy assignment operator

聽(tīng)聽(tīng)聽(tīng) Empty& operator=(const Empty& rhs) {}

}

褰撶劧錛岃繖浜涘嚱鏁板彧鏈夊畠浠湡姝h闇瑕佺殑鏃跺欐墠浼?xì)琚垱寰忋備笅闈㈣繖浜涙儏鍐典細(xì)浣垮緱榪欎簺鍑芥暟琚垱寤猴細(xì)

Empty e1; // default constructor & destructor

Empty e2(e1); // copy constructor

e2 = e1; // copy assignment operator

鏃㈢劧緙栬瘧鍣ㄤ細(xì)涓轟綘鍒涘緩榪欎簺鍑芥暟錛岄偅涔堣繖浜涘嚱鏁伴兘鍋氫簺浠涔堝伐浣滃憿錛熼粯璁ょ殑鏋勯犲拰鏋愭瀯鍑芥暟涓昏鏄緙栬瘧鍣ㄦ斁緗竴浜涙墽琛屸滃箷鍚庡伐浣溾濈殑浠g爜錛屼緥濡傝皟鐢ㄥ熀綾誨拰闈為潤(rùn)鎬佹暟鎹垚鍛樼殑鏋勯犲拰鏋愭瀯鍑芥暟絳夈傞渶瑕佹敞鎰忕殑鏄紪璇戝櫒涓轟綘鐢熸垚鐨勮繖涓瀽鏋勫嚱鏁板茍涓嶆槸铏氭嫙鐨勶紝闄ら潪榪欎釜綾葷殑鍩虹被鏄庣‘澹版槑浜?jiǎn)涓涓櫄鎷熺殑鏋愭瀯鍑芥暟銆?span lang="EN-US">

瀵逛簬鎷瘋礉鏋勯犲嚱鏁板拰璧嬪艱繍綆楃錛岀紪璇戝櫒鐢熸垚鐨勭増鏈彧鏄畝鍗曠殑copy姣忎竴涓潪闈?rùn)鎬佹暟鎹垚鍛樸備緥濡傦紝鑰冭檻涓涓悕涓?span lang="EN-US">NamedObject鐨勬ā鏉?span lang="EN-US">,瀹冨彲浠ヨ浣犳妸鍚嶅瓧鍜岀被鍨?span lang="EN-US">T鍏寵仈璧鋒潵銆?/font>

template <typename T>

class NamedObject {

public :

聽(tīng)聽(tīng)聽(tīng) NamedObject(constchar* name, const T& value);

聽(tīng)聽(tīng)聽(tīng) NamedObject(const std::string& name, const T& value);

聽(tīng)

private :

聽(tīng)聽(tīng)聽(tīng) std::string nameValue;

聽(tīng)聽(tīng)聽(tīng) T objectValue;

};

鐢變簬NamedObject涓0鏄庝簡(jiǎn)鏋勯犲嚱鏁幫紝緙栬瘧鍣ㄤ究涓嶄細(xì)鍐嶈嚜鍋氫富寮犱負(fù)浣犵敓鎴愪竴涓粯璁ょ殑銆傝繖鏄緢閲嶈鐨勩傝繖鎰忓懗鐫濡傛灉浣犵簿蹇?jī)璁捐鐨劸c葷殑鏋勯犳柟寮忥紝浣犲氨涓嶇敤鍐嶅幓鎷呭績(jī)緙栬瘧鍣ㄤ細(xì)鎰氳牏鐨勪負(fù)浣犳坊鍔犱竴涓笉甯﹀弬鏁扮殑鏋勯犲嚱鏁拌岀牬鍧忎綘鐨勮璁°?span lang="EN-US">

NamedObject 涓棦娌℃湁澹版槑鎷瘋礉鏋勯犲嚱鏁頒篃娌℃湁澹版槑璧嬪艱繍綆楃錛屾墍浠ュ綋闇瑕佺殑鏃跺欙紝緙栬瘧鍣ㄤ細(xì)鑷姩涓轟綘鐢熸垚銆傛樉鐒?dòng)灱屼笅闈㈢殑浠g爜闇瑕佹嫹璐濇瀯閫犲嚱鏁扮殑鏀寔錛?span lang="EN-US">

NamedObject<int> no1("Smallest Prime Number", 2);

NamedObject<int> no2(no1);

no1.nameValue鍜?span lang="EN-US">no1.objectValue鏉ュ垵濮嬪寲no2涓搴旂殑鎴愬憳銆傜敱浜?span lang="EN-US">nameValue鐨勭被鍨嬫槸string錛屽茍涓旀爣鍑嗙殑string鏈変竴涓嫹璐濇瀯閫犲嚱鏁幫紝鎵浠?span lang="EN-US">no2.nameValue灝卞彲浠ラ氳繃string鐨勬嫹璐濇瀯閫犲嚱鏁板畬鎴愩傚彟澶?span lang="EN-US">objectValue鏄竴涓暣鏁幫紝瀵逛簬榪欎釜鍐呯疆綾誨瀷錛岀畝鍗曠殑bit-copy灝卞彲浠ュ畬鎴愬鍒剁殑浠誨姟浜?jiǎn)銆?span lang="EN-US">

NamedObject鏉ョ敓鎴愪竴涓祴鍊艱繍綆楃銆備絾鏄紝鍙湁褰撶敓鎴愮殑浠g爜鍦ㄨ娉曞拰璇箟閮介兘姝g‘鐨勬椂鍊欙紝緙栬瘧鍣ㄦ墠浼?xì)湄?fù)浣犳墽琛岀敓鎴愬伐浣滐紝濡傛灉鍏朵腑浠諱綍涓鏂歸潰闄や簡(jiǎn)闂錛岀紪璇戝櫒灝變細(xì)鎷掔粷涓轟綘閲嶈澆operator =銆?span lang="EN-US">

NamedObject錛?span lang="EN-US">

template <typename T>

class NamedObject {

public :

聽(tīng)聽(tīng)聽(tīng) NamedObject(const std::string& name, const T& value);

聽(tīng)

private :

聽(tīng)聽(tīng)聽(tīng) std::string& nameValue;

聽(tīng)聽(tīng)聽(tīng) const T objectValue;
};

涔嬪悗錛屼笅闈㈢殑浠g爜浼?xì)鎬庢牱鍛紵

std::string newDog("Persephone");

std::string oldDog("Satch");

NamedObject<int> p(newDog, 2);

NamedObject<int> s(oldDog, 36);
p = s; // What should happen?

p.nameValue鍜?span lang="EN-US">s.nameValue鍒嗗埆鎸囧悜涓嶅悓鐨?span lang="EN-US">string瀵硅薄銆傝繖涓鍒跺簲璇ュp.nameValue鍋氭庢牱鐨勬敼鍙樺憿錛熺洿瑙変笂錛?span lang="EN-US">p.nameValue灝嗕細(xì)鎸囧悜s.nameValue鎵鎸囩殑string瀵硅薄銆備絾鏄繖鐮村潖浜?span lang="EN-US">C++鐨勪竴鏉″熀鏈殑鍑嗗垯錛?span lang="EN-US">C++涓嶅厑璁稿紩鐢ㄦ寚鍚戜笉鍚岀殑瀵硅薄銆傛崲鍙ヨ瘽璇達(dá)紝闅鵑亾鏀瑰彉p.nameValue鎵寮曠敤鐨勫璞″簲璇ヨ褰卞搷鍒板叾瀹冨璞℃墍寮曠敤鐨勫瓧絎︿覆鍚楋紵榪欐槸緙栬瘧鍣ㄧ敓鎴愮殑璧嬪艱繍綆楃搴旇鍋氱殑浜嬫儏鍚楋紵

瀵逛簬榪欎釜闂鐨勮В絳旀柟娉曟槸鎷掔粷緙栬瘧榪欐牱鐨勪唬鐮併傚鏋滀綘鎯寵鍚湁寮曠敤鏁版嵁鎴愬憳鐨勭被鏀寔璧嬪煎姛鑳斤紝閭d箞浣犲氨蹇呴』鑷繁瀹氫箟璧嬪艱繍綆楃銆傚浜庡惈鏈?font face="鏂板畫(huà)浣?>const鏁版嵁鎴愬憳鐨勭被鏉ヨ錛屾晠浜嬫槸綾諱技鐨勩備慨鏀瑰璞′腑鐨?span lang="EN-US">const鎴愬憳鎬繪槸闈炴硶鐨勶紝鎵浠ョ紪璇戝櫒瀵逛簬濡備綍澶勭悊榪欑闂?shù)竴鏃犳墍鐭ャ傛渶鍚庯紝濡傛灉鍩虹被鎶?span lang="EN-US">operator=澹版槑涓?span lang="EN-US">private錛岄偅涔堢紪璇戝櫒鍚屾牱浼?xì)鎷捑l濅負(fù)媧劇敓綾葷敓鎴?span lang="EN-US">operator=銆傛瘯绔燂紝涓鏂歸潰錛屽嵆渚跨紪璇戝櫒鍙互鐢熸垚錛?span lang="EN-US">operator=涔熷彧鑳藉鐞嗘淳鐢熺被涓睘浜庡熀綾葷殑閭d竴閮ㄥ垎錛涘彟涓鏂歸潰錛屾淳鐢熺被涔熸牴鏈棤鏉冭闂熀綾諱腑鐨?span lang="EN-US">private鎴愬憳銆?span lang="EN-US">

l 聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng) operator=鍜屾瀽鏋勫嚱鏁般?span lang="EN-US">



nacci 2005-11-03 09:17 鍙戣〃璇勮
]]>
国产农村妇女毛片精品久久| 久久久久久一区国产精品| 精产国品久久一二三产区区别| 一本久久a久久精品综合香蕉| 99久久综合国产精品免费| 99久久精品日本一区二区免费| 亚洲一本综合久久| 亚洲国产精品无码久久一线| 狠狠色婷婷综合天天久久丁香| 合区精品久久久中文字幕一区 | 人人狠狠综合久久88成人| 91久久九九无码成人网站 | 2020国产成人久久精品| 性做久久久久久久| 久久精品综合网| 久久综合综合久久狠狠狠97色88| 亚洲AV伊人久久青青草原| 91精品国产91久久久久久| 久久亚洲国产成人精品性色| 热久久国产欧美一区二区精品| 69久久夜色精品国产69| 久久久久免费精品国产| 无码人妻久久一区二区三区蜜桃 | 久久精品aⅴ无码中文字字幕不卡 久久精品aⅴ无码中文字字幕重口 | 欧美日韩精品久久免费| 国产成人精品久久综合| 久久99国产精品尤物| 久久亚洲精品无码VA大香大香| 久久久久久国产精品免费免费| 久久免费视频网站| 国产精品久久久亚洲| 99久久国产综合精品麻豆| 亚洲精品高清国产一线久久| 久久久久久精品免费免费自慰| 日日狠狠久久偷偷色综合0| 蜜桃麻豆www久久国产精品| 人妻无码精品久久亚瑟影视| 狠狠久久综合| 亚洲国产精品狼友中文久久久| 久久婷婷五月综合97色直播| 中文字幕无码久久人妻|