锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美日韩大片,欧美一区二区视频观看视频,欧美三级电影一区http://www.shnenglu.com/wlwlxj/category/1324.html<div>涓涓悆杞キ鐨勭敺浜?!!!!鎴戝彧鎯沖啓紼嬪簭####<br>甯堝し涔嬫妧浠ュ埗澶? 鍚懼皾緇堟棩鑰屾濈煟,涓嶅欏昏嚲涔嬫墍瀛︿篃<br>鍠濈瀛熷﹩姹?韙忚繃濂堜綍妗?娑呮</div> I've been programming since I was 21. Started with C++, looked at Java, keen on Visual Basic and Visual C++, thinking about .NET and C#.^_^,very ridiculous.zh-cnTue, 20 May 2008 09:27:26 GMTTue, 20 May 2008 09:27:26 GMT60鍔ㄦ佸鎬佷笌闈?rùn)鎬佸鎬?/title><link>http://www.shnenglu.com/wlwlxj/archive/2006/09/25/12936.html</link><dc:creator>涓囪繛鏂?/dc:creator><author>涓囪繛鏂?/author><pubDate>Mon, 25 Sep 2006 02:38:00 GMT</pubDate><guid>http://www.shnenglu.com/wlwlxj/archive/2006/09/25/12936.html</guid><wfw:comment>http://www.shnenglu.com/wlwlxj/comments/12936.html</wfw:comment><comments>http://www.shnenglu.com/wlwlxj/archive/2006/09/25/12936.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/wlwlxj/comments/commentRss/12936.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/wlwlxj/services/trackbacks/12936.html</trackback:ping><description><![CDATA[鍔ㄦ佸鎬侀氳繃緇ф壙+铏氬嚱鏁板疄鐜幫紝闈?rùn)鎬佸鎬侀氳繃妯$増瀹炵幇銆?br />鍔ㄦ佸鎬佺湅涓婂幓寰堣嚜鐒舵竻鏅幫紝闄ゆ涔嬪鎬曟槸娌℃湁鍒殑濂藉銆傝繖涔熸槸涓轟粈涔坰tl銆乥oost涓轟竴緹よ娉曢珮鎵嬫墍浜茬湳鐨勫師鍥犮傝瀹炶瘽緇忓父涓鐪嬪埌妯$増閮芥墦鍐鋒垬錛岃鏄ā鐗堝弬鏁頒竴澶氾紝鐞嗘竻涔嬮棿鍏崇郴灝卞緱鍖栧緢澶氭椂闂淬備笉榪囨煇浜涘湴鏂癸紝浣跨敤妯$増鏉ュ疄鐜頒竴浜涘簳灞傚姛鑳借兘杈懼埌鎰忔兂涓嶅埌鐨勬晥鏋溿?br />闈?rùn)鎬佸鎬佺殑濂藉錛?br />1銆佸彲浠ュ鎬佹垚鍛樺彉閲?鑷垱鐨勮娉曞摝^_^)<br />2銆侀伩鍏嶈櫄鎸囬拡鐨勫唴瀛樻崯鑰椾互鍙?qiáng)铏氬嚱鏁拌皟鐢q愯鏁堢巼鎹熻?br />緙虹偣錛?br />1銆佸洜涓虹紪璇戞椂浼?xì)鍔犲叆绫诲瀷鐨劶嫯瀹氬Q屼唬鐮佸昂瀵鎬細(xì)紼嶇◢澶т竴鐐?br />2銆佹棤娉曞澶氭佸璞$粺涓澶勭悊錛屽鎬佹х◢鏈夋姌鎵?br /><br />MFC綾誨緢灝戜嬌鐢ㄦā鐗堬紝鑰學(xué)TL綾誨ぇ閲忎嬌鐢ㄦā鐗堛傛垜鍦ㄧ湅WTL浠g爜鐨勬椂鍊欙紝緇忓父琚噷闈㈢殑瀹炵幇鎵榪鋒儜錛屽洜涓洪噷闈㈡湁寰堝璁捐閲囩敤鍔ㄦ佸鎬佸拰闈?rùn)鎬佸鎬佺粨鍚堜嬌鐢紝榪欏彲鑳芥槸涓縐嶄笉閿欑殑緇撳悎銆備笅闈㈡垜鐢ㄤ竴孌典唬鐮佹紨紺鴻繖浜涚壒鐐癸紝鐪嬩笂鍘誨緢騫沖父錛?br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)Virtual聽(tīng)&&聽(tīng)inherit</span><span style="COLOR: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)Category1<br /><img id="Codehighlighter1_38_80_Open_Image" onclick="this.style.display='none'; Codehighlighter1_38_80_Open_Text.style.display='none'; Codehighlighter1_38_80_Closed_Image.style.display='inline'; Codehighlighter1_38_80_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_38_80_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_38_80_Closed_Text.style.display='none'; Codehighlighter1_38_80_Open_Image.style.display='inline'; Codehighlighter1_38_80_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_38_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_38_80_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">virtual</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">聽(tīng)SayCatName()聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #000000">0</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><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)Car1聽(tīng):聽(tīng)</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽(tīng)Category1<br /><img id="Codehighlighter1_114_221_Open_Image" onclick="this.style.display='none'; Codehighlighter1_114_221_Open_Text.style.display='none'; Codehighlighter1_114_221_Closed_Image.style.display='inline'; Codehighlighter1_114_221_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_114_221_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_114_221_Closed_Text.style.display='none'; Codehighlighter1_114_221_Open_Image.style.display='inline'; Codehighlighter1_114_221_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_114_221_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_114_221_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)m_strName;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">virtual</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">聽(tīng)SayCatName()<br /><img id="Codehighlighter1_187_219_Open_Image" onclick="this.style.display='none'; Codehighlighter1_187_219_Open_Text.style.display='none'; Codehighlighter1_187_219_Closed_Image.style.display='inline'; Codehighlighter1_187_219_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_187_219_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_187_219_Closed_Text.style.display='none'; Codehighlighter1_187_219_Open_Image.style.display='inline'; Codehighlighter1_187_219_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 id="Codehighlighter1_187_219_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_187_219_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)聽(tīng)聽(tīng)聽(tīng)cout聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)m_strName聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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" /></span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">聽(tīng)Car1::m_strName聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Car1</span><span style="COLOR: #000000">"</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><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)House1聽(tīng):聽(tīng)</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽(tīng)Category1<br /><img id="Codehighlighter1_290_397_Open_Image" onclick="this.style.display='none'; Codehighlighter1_290_397_Open_Text.style.display='none'; Codehighlighter1_290_397_Closed_Image.style.display='inline'; Codehighlighter1_290_397_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_290_397_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_290_397_Closed_Text.style.display='none'; Codehighlighter1_290_397_Open_Image.style.display='inline'; Codehighlighter1_290_397_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_290_397_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_290_397_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">private</span><span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)m_strName;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">virtual</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">聽(tīng)SayCatName()<br /><img id="Codehighlighter1_363_395_Open_Image" onclick="this.style.display='none'; Codehighlighter1_363_395_Open_Text.style.display='none'; Codehighlighter1_363_395_Closed_Image.style.display='inline'; Codehighlighter1_363_395_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_363_395_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_363_395_Closed_Text.style.display='none'; Codehighlighter1_363_395_Open_Image.style.display='inline'; Codehighlighter1_363_395_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 id="Codehighlighter1_363_395_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_363_395_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)聽(tīng)聽(tīng)聽(tīng)cout聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)m_strName聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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" /></span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">聽(tīng)House1::m_strName聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Hourse1</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)!(Virtual聽(tīng)&&聽(tīng)inherit)<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><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)Template</span><span style="COLOR: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">typename聽(tīng)T</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)Category2<br /><img id="Codehighlighter1_513_646_Open_Image" onclick="this.style.display='none'; Codehighlighter1_513_646_Open_Text.style.display='none'; Codehighlighter1_513_646_Closed_Image.style.display='inline'; Codehighlighter1_513_646_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_513_646_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_513_646_Closed_Text.style.display='none'; Codehighlighter1_513_646_Open_Image.style.display='inline'; Codehighlighter1_513_646_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_513_646_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_513_646_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">protected</span><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)</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">聽(tīng)m_strName;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">virtual</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">聽(tīng)SayCatName()<br /><img id="Codehighlighter1_588_644_Open_Image" onclick="this.style.display='none'; Codehighlighter1_588_644_Open_Text.style.display='none'; Codehighlighter1_588_644_Closed_Image.style.display='inline'; Codehighlighter1_588_644_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_588_644_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_588_644_Closed_Text.style.display='none'; Codehighlighter1_588_644_Open_Image.style.display='inline'; Codehighlighter1_588_644_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 id="Codehighlighter1_588_644_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_588_644_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)聽(tīng)聽(tīng)聽(tīng)T</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)pT聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)static_cast</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T</span><span style="COLOR: #000000">*></span><span style="COLOR: #000000">(</span><span style="COLOR: #0000ff">this</span><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)聽(tīng)聽(tīng)聽(tīng)pT</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">SayCatName();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)Car2聽(tīng):聽(tīng)</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽(tīng)Category2</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">Car2</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_686_758_Open_Image" onclick="this.style.display='none'; Codehighlighter1_686_758_Open_Text.style.display='none'; Codehighlighter1_686_758_Closed_Image.style.display='inline'; Codehighlighter1_686_758_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_686_758_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_686_758_Closed_Text.style.display='none'; Codehighlighter1_686_758_Open_Image.style.display='inline'; Codehighlighter1_686_758_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_686_758_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_686_758_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">virtual</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">聽(tīng)SayCatName()<br /><img id="Codehighlighter1_724_756_Open_Image" onclick="this.style.display='none'; Codehighlighter1_724_756_Open_Text.style.display='none'; Codehighlighter1_724_756_Closed_Image.style.display='inline'; Codehighlighter1_724_756_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_724_756_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_724_756_Closed_Text.style.display='none'; Codehighlighter1_724_756_Open_Image.style.display='inline'; Codehighlighter1_724_756_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 id="Codehighlighter1_724_756_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_724_756_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)聽(tīng)聽(tīng)聽(tīng)cout聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)m_strName聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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" /></span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">聽(tīng)Car2::m_strName聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Car2</span><span style="COLOR: #000000">"</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><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)House2聽(tīng):聽(tīng)</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽(tīng)Category2</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">House2</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_835_907_Open_Image" onclick="this.style.display='none'; Codehighlighter1_835_907_Open_Text.style.display='none'; Codehighlighter1_835_907_Closed_Image.style.display='inline'; Codehighlighter1_835_907_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_835_907_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_835_907_Closed_Text.style.display='none'; Codehighlighter1_835_907_Open_Image.style.display='inline'; Codehighlighter1_835_907_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_835_907_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_835_907_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">virtual</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">聽(tīng)SayCatName()<br /><img id="Codehighlighter1_873_905_Open_Image" onclick="this.style.display='none'; Codehighlighter1_873_905_Open_Text.style.display='none'; Codehighlighter1_873_905_Closed_Image.style.display='inline'; Codehighlighter1_873_905_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_873_905_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_873_905_Closed_Text.style.display='none'; Codehighlighter1_873_905_Open_Image.style.display='inline'; Codehighlighter1_873_905_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 id="Codehighlighter1_873_905_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_873_905_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)聽(tīng)聽(tīng)聽(tīng)cout聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)m_strName聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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" /></span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">聽(tīng)House2::m_strName聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">House2</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)!(Template)<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><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)Virtual聽(tīng)&&聽(tīng)inherit聽(tīng)&&聽(tīng)Template</span><span style="COLOR: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)CategoryBase<br /><img id="Codehighlighter1_1016_1058_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1016_1058_Open_Text.style.display='none'; Codehighlighter1_1016_1058_Closed_Image.style.display='inline'; Codehighlighter1_1016_1058_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1016_1058_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1016_1058_Closed_Text.style.display='none'; Codehighlighter1_1016_1058_Open_Image.style.display='inline'; Codehighlighter1_1016_1058_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_1016_1058_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_1016_1058_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">virtual</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">聽(tīng)SayCatName()聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #000000">0</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" />template</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">typename聽(tīng)T,聽(tīng)typename聽(tīng)TBase</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">CategoryBase</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)CategoryImpl聽(tīng):聽(tīng)</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽(tīng)TBase<br /><img id="Codehighlighter1_1146_1185_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1146_1185_Open_Text.style.display='none'; Codehighlighter1_1146_1185_Closed_Image.style.display='inline'; Codehighlighter1_1146_1185_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1146_1185_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1146_1185_Closed_Text.style.display='none'; Codehighlighter1_1146_1185_Open_Image.style.display='inline'; Codehighlighter1_1146_1185_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_1146_1185_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_1146_1185_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">protected</span><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)</span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)m_strName;<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><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)Car3聽(tīng):聽(tīng)</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽(tīng)CategoryImpl</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">Car3</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_1228_1300_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1228_1300_Open_Text.style.display='none'; Codehighlighter1_1228_1300_Closed_Image.style.display='inline'; Codehighlighter1_1228_1300_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1228_1300_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1228_1300_Closed_Text.style.display='none'; Codehighlighter1_1228_1300_Open_Image.style.display='inline'; Codehighlighter1_1228_1300_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_1228_1300_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_1228_1300_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">virtual</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">聽(tīng)SayCatName()<br /><img id="Codehighlighter1_1266_1298_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1266_1298_Open_Text.style.display='none'; Codehighlighter1_1266_1298_Closed_Image.style.display='inline'; Codehighlighter1_1266_1298_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1266_1298_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1266_1298_Closed_Text.style.display='none'; Codehighlighter1_1266_1298_Open_Image.style.display='inline'; Codehighlighter1_1266_1298_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 id="Codehighlighter1_1266_1298_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_1266_1298_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)聽(tīng)聽(tīng)聽(tīng)cout聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)m_strName聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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" /></span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">聽(tīng)Car3::m_strName聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">Car3</span><span style="COLOR: #000000">"</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><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)House3聽(tīng):聽(tīng)</span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">聽(tīng)CategoryImpl</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">House3</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img id="Codehighlighter1_1380_1452_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1380_1452_Open_Text.style.display='none'; Codehighlighter1_1380_1452_Closed_Image.style.display='inline'; Codehighlighter1_1380_1452_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1380_1452_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1380_1452_Closed_Text.style.display='none'; Codehighlighter1_1380_1452_Open_Image.style.display='inline'; Codehighlighter1_1380_1452_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_1380_1452_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_1380_1452_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">virtual</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000">聽(tīng)SayCatName()<br /><img id="Codehighlighter1_1418_1450_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1418_1450_Open_Text.style.display='none'; Codehighlighter1_1418_1450_Closed_Image.style.display='inline'; Codehighlighter1_1418_1450_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_1418_1450_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1418_1450_Closed_Text.style.display='none'; Codehighlighter1_1418_1450_Open_Image.style.display='inline'; Codehighlighter1_1418_1450_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 id="Codehighlighter1_1418_1450_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_1418_1450_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)聽(tīng)聽(tīng)聽(tīng)cout聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)m_strName聽(tīng)</span><span style="COLOR: #000000"><<</span><span style="COLOR: #000000">聽(tīng)endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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" /></span><span style="COLOR: #0000ff">string</span><span style="COLOR: #000000">聽(tīng)House3::m_strName聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">House3</span><span style="COLOR: #000000">"</span><span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)!(Virtual聽(tīng)&&聽(tīng)inherit聽(tīng)&&聽(tīng)Template)</span><span style="COLOR: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">聽(tīng)_tmain(</span><span style="COLOR: #0000ff">int</span><span style="COLOR: #000000">聽(tīng)argc,聽(tīng)_TCHAR</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(tīng)argv[])<br /><img id="Codehighlighter1_1567_2332_Open_Image" onclick="this.style.display='none'; Codehighlighter1_1567_2332_Open_Text.style.display='none'; Codehighlighter1_1567_2332_Closed_Image.style.display='inline'; Codehighlighter1_1567_2332_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_1567_2332_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_1567_2332_Closed_Text.style.display='none'; Codehighlighter1_1567_2332_Open_Image.style.display='inline'; Codehighlighter1_1567_2332_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_1567_2332_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_1567_2332_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)</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)test聽(tīng)Virtual聽(tīng)&&聽(tīng)inherit</span><span style="COLOR: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)Category1</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)pCatInstance聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽(tīng)Car1();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pCatInstance</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">SayCatName();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)delete聽(tīng)pCatInstance;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pCatInstance聽(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" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pCatInstance聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽(tīng)House1();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pCatInstance</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">SayCatName();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)delete聽(tīng)pCatInstance;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pCatInstance聽(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" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)!(test聽(tīng)Virtual聽(tīng)&&聽(tīng)inherit)<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: #008000">//</span><span style="COLOR: #008000">聽(tīng)test聽(tīng)Template</span><span style="COLOR: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)Category2</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">Car2</span><span style="COLOR: #000000">>*</span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)pCar2聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽(tīng)Car2();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pCar2</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">SayCatName();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)delete聽(tīng)pCar2;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pCar2聽(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" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)Category2</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">House2</span><span style="COLOR: #000000">>*</span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)pHouse2聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽(tīng)House2();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pHouse2</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">SayCatName();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)delete聽(tīng)pHouse2;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pHouse2聽(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" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)!(test聽(tīng)Template)<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: #008000">//</span><span style="COLOR: #008000">聽(tīng)test聽(tīng)Virtual聽(tīng)&&聽(tīng)inherit聽(tīng)&&聽(tīng)Template</span><span style="COLOR: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)CategoryBase</span><span style="COLOR: #000000">*</span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)pBase聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽(tīng)Car3();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pBase</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">SayCatName();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)delete聽(tīng)pBase;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pBase聽(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" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pBase聽(tīng)</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000">聽(tīng)House3();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pBase</span><span style="COLOR: #000000">-></span><span style="COLOR: #000000">SayCatName();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)delete聽(tīng)pBase;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pBase聽(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" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">聽(tīng)!(test聽(tīng)Virtual聽(tīng)&&聽(tīng)inherit聽(tīng)&&聽(tīng)Template)</span><span style="COLOR: #008000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span><span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span><span style="COLOR: #0000ff">return</span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #000000">0</span><span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span></div>閲岄潰浣撶幇浜?jiǎn)寰堝鐗规э紝鏈変簺渚嬪闈?rùn)鎬佸嚱鏁扮殑宸у浣跨敤娌℃湁婕旂ず銆?br /><br />渚嬪瓙瀹屽叏鏄湰浜鴻噯鎯沖嚭鏉ョ殑錛屾病鏈夊疄闄呮剰涔夛紝浠呬粠璇硶涓婂幓鑰冭檻銆?img src ="http://www.shnenglu.com/wlwlxj/aggbug/12936.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/wlwlxj/" target="_blank">涓囪繛鏂?/a> 2006-09-25 10:38 <a href="http://www.shnenglu.com/wlwlxj/archive/2006/09/25/12936.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>std::string涓涓瀬鍏墮殣鏅﹀緱闂http://www.shnenglu.com/wlwlxj/archive/2006/04/18/5819.html涓囪繛鏂?/dc:creator>涓囪繛鏂?/author>Tue, 18 Apr 2006 08:23:00 GMThttp://www.shnenglu.com/wlwlxj/archive/2006/04/18/5819.htmlhttp://www.shnenglu.com/wlwlxj/comments/5819.htmlhttp://www.shnenglu.com/wlwlxj/archive/2006/04/18/5819.html#Feedback7http://www.shnenglu.com/wlwlxj/comments/commentRss/5819.htmlhttp://www.shnenglu.com/wlwlxj/services/trackbacks/5819.html鏄ㄥぉ鍋氫竴涓猟ll錛屼唬鐮佸緢蹇啓瀹屼簡(jiǎn)錛岀劧鑰屼嬌鐢ㄥ緱鏃跺欐繪槸閬囧埌string鍐呴儴鎸囬拡鍒犻櫎閿欒錛岄儊闂蜂簡(jiǎn)涓澶╋紝浠婂ぉ娌″幓鍏徃錛屽ソ濂界爺絀朵簡(jiǎn)涓涓嬨?br />棣栧厛鐪嬩笅涓嬮潰榪欐浠g爜錛屽0鏄庝袱涓猻tring瀵硅薄錛?br />

std:: string 聽(tīng)聽(tīng)s1聽(tīng) = 聽(tīng) " wlwlxj " ;
std::
string 聽(tīng)聽(tīng)s2聽(tīng) = 聽(tīng) " lxjwlwww " ;

璋冭瘯鐘舵佷笅鍙互鐪嬪埌鍐呴儴鎸囬拡錛?br />s1=0x00364ff9
s2=0x00365061
鐒跺悗鎵ц

s2聽(tīng) = 聽(tīng)s1;

鎸変笅f11錛岃繘鍏string婧愭枃浠訛細(xì)

_Myt & 聽(tīng) operator = ( const 聽(tīng)_Myt & 聽(tīng)_X)聽(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)(assign(_X));聽(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)// 璋冪敤assign鍑芥暟

緇х畫(huà)榪涘叆assign(_X)鍑芥暟錛?/p>

_Myt & 聽(tīng)assign( const 聽(tīng)_Myt & 聽(tīng)_X)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
{ return 聽(tīng)(assign(_X,聽(tīng) 0 ,聽(tīng)npos));聽(tīng)}聽(tīng)聽(tīng)聽(tīng)// 璋冪敤assign鍑芥暟
緇х畫(huà)榪涘叆assign鍑芥暟錛屽ソ鎴忛兘鍦ㄨ繖閲岄潰錛?br />
_Myt&聽(tīng)assign(const聽(tīng)_Myt&聽(tīng)_X,聽(tīng)size_type聽(tīng)_P,聽(tīng)size_type聽(tīng)_M)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
{if聽(tīng)(_X.size()聽(tīng)<聽(tīng)_P)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)_Xran();
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)size_type聽(tīng)_N聽(tīng)
=聽(tīng)_X.size()聽(tīng)-聽(tīng)_P;
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
if聽(tīng)(_M聽(tīng)<聽(tīng)_N)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)_N聽(tīng)
=聽(tīng)_M;
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
if聽(tīng)(this聽(tīng)==聽(tīng)&_X)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)erase((size_type)(_P聽(tīng)
+聽(tīng)_N)),聽(tīng)erase(0,聽(tīng)_P);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
else聽(tīng)if聽(tīng)(0聽(tīng)<聽(tīng)_N聽(tīng)&&聽(tīng)_N聽(tīng)==聽(tīng)_X.size()聽(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)_Refcnt(_X.c_str())聽(tīng)<聽(tīng)_FROZEN聽(tīng)-聽(tīng)1聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)// 婧愬瓧絎︿覆寮曠敤嬈℃暟灝戜簬255-1嬈★紙鍙寮曠敤嬈℃暟鏈澶?55嬈★級(jí)錛?/span>
聽(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)allocator聽(tīng)==聽(tīng)_X.allocator)聽(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)//涓旀簮瀛楃鍜岀洰鐨勫瓧絎﹀垎閰嶅櫒涓鑷?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){_Tidy(true);聽(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)_Ptr聽(tīng)
=聽(tīng)(_E聽(tīng)*)_X.c_str();聽(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)_Len聽(tīng)
=聽(tīng)_X.size();
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)_Res聽(tīng)
=聽(tīng)_X.capacity();
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
++_Refcnt(_Ptr);聽(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)// 澧炲姞涓嬈″紩鐢?/span>
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
else聽(tīng)if聽(tīng)(_Grow(_N,聽(tīng)true))
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
{_Tr::copy(_Ptr,聽(tīng)&_X.c_str()[_P],聽(tīng)_N);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)_Eos(_N);聽(tīng)}

聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
return聽(tīng)(*this);聽(tīng)}

榪欐牱緇撴灉灝辨槸璋冪敤=鍙蜂互鍚庯紝s2鍦板潃鍜宻1鍦板潃涓鏍鳳紝閮芥槸0x00364ff9銆?br />
鍋囧鎴戜滑鍔ㄦ佸簱鏈夎繖鏍蜂竴涓被class DLL鎺ュ彛錛?/p>

SetString(std::string聽(tīng)str)
{
m_str聽(tīng)
=聽(tīng)str;
}

鍦ㄥ鎴瘋皟鐢ㄦ椂鍊欙細(xì)

std::string聽(tīng)str聽(tīng)=聽(tīng)"wlwlxj";
DLL聽(tīng)d;
d.SetString(str);聽(tīng)
//聽(tīng)姝ゆ椂娌℃湁娣辨嫹璐濓紝鑰屾槸寮曠敤浜?jiǎn)str鍐呴儴鎸囬拡鍦板潃
鍦ㄨ皟鐢ㄧ粨鏉熺殑鏃跺欙紝dll鍐呴儴鍒犻櫎鎴愬憳鍙橀噺鐨勬椂鍊欙紝浼?xì)鍒ゆ柇m_str鍐呴儴鎸囬拡鍚堟硶鎬э紝鐢變簬瀹為檯鍒嗛厤鏄湪璋冪敤绔紝鍦╠ll鍐呴儴鑷劧媯(gè)鏌ユ寚閽堥潪娉曘?br />
瑙e喅鏂規(guī)硶灝辨槸閬垮厤std::string寮曠敤璁℃暟錛屾帴鍙e淇敼涓篠etString(const char*)錛岃繖鏍峰湪dll鍐呴儴鍒嗛厤鍐呭瓨錛屽唴閮ㄩ噴鏀撅紝灝變笉浼?xì)鏈夐棶棰樸?img src ="http://www.shnenglu.com/wlwlxj/aggbug/5819.html" width = "1" height = "1" />

]]>
C++ Template: The Complete Guide 瀛︿範(fàn)錛? 妯℃澘涓殑鍛藉悕http://www.shnenglu.com/wlwlxj/archive/2006/04/08/5169.html涓囪繛鏂?/dc:creator>涓囪繛鏂?/author>Sat, 08 Apr 2006 03:38:00 GMThttp://www.shnenglu.com/wlwlxj/archive/2006/04/08/5169.htmlhttp://www.shnenglu.com/wlwlxj/comments/5169.htmlhttp://www.shnenglu.com/wlwlxj/archive/2006/04/08/5169.html#Feedback0http://www.shnenglu.com/wlwlxj/comments/commentRss/5169.htmlhttp://www.shnenglu.com/wlwlxj/services/trackbacks/5169.html絎?绔?妯℃澘涓殑鍚嶅瓧
鍚嶅瓧鍦ㄥぇ澶氭暟緙栫▼璇█涓兘鏄渶鍩烘湰鐨勬蹇碉紝紼嬪簭鍛樼敤瀹冩潵寮曠敤鍏堝墠鍒涘緩鐨勫璞°傚綋C++緙栬瘧鍣ㄩ亣鍒頒竴涓悕瀛楋紝瀹冭鍘繪煡鎵懼茍璇嗗埆鍝釜瀵硅薄琚紩鐢ㄣ備粠瀹炵幇鑰呰搴︽潵鐪嬶紝C++鍦ㄤ竴縐嶅己綾誨瀷璇█銆傝冭檻琛ㄨ揪寮廥*Y錛氬鏋淴鍜孻閮芥槸鍙橀噺鍚嶏紝閭d箞鏄箻娉曡〃杈懼紡錛涘鏋淴鏄被鍨嬪悕錛岃繖鏉¤鍙ユ妸Y澹版槑涓篨綾誨瀷鐨勪竴涓寚閽堛?br />
榪欎釜渚嬪瓙琛ㄦ槑C++錛堝拰C涓鏍鳳級(jí)鏄笂涓嬫枃鏁忔劅鐨勮璦錛氬鏋滄病鏈変笂涓嬫枃錛屼竴鏉$▼搴忔寚浠ゅ緢闅捐緙栬瘧鍣ㄧ悊瑙c傝繖涓庢ā鏉挎湁浠涔堝叧緋誨憿錛熷棷錛屾ā鏉垮繀欏誨鐞嗘洿澶氱殑涓婁笅鏂囷細(xì)(1)妯℃澘鍐呴儴涓婁笅鏂囷紱(2)妯℃澘瀹炰緥鍖栨椂鐨勪笂涓嬫枃錛?3)妯℃澘瀹炰緥鍖栨椂妯℃澘鍙傛暟鐨勪笂涓嬫枃銆傚湪C++涓繀欏誨皬蹇?jī)澶勭悊鍚嶅瓧锛屽?guī)浣犱笉搴旇鎰熷埌鎯婅銆?br />
9.1 鍚嶅瓧鍒嗙被瀛?/strong>
浜嬪疄涓奀++鐨勫悕瀛楀垎綾繪湁寰堝縐嶃備負(fù)浜?jiǎn)渚夸簬璁板繂锛屾垜浠彁渚涗簡(jiǎn)琛ㄦ?.1鍜岃〃鏍?.2鎻忚堪浜?jiǎn)杩欎簺鍒喚c匯傚垢榪愮殑鏄綘鍙敤鐔熸?zhèn)変笅闈?縐嶄富瑕佺殑鍛藉悕姒傚康錛屽氨鍙互寰堝ソ鐨勭悊瑙++妯℃澘涓亣鍒扮殑闂錛?br />
1銆侀檺瀹氬悕錛氬悕瀛楀湪浣滅敤鍩熶腑琚樉寮忔寚紺轟綔鐢ㄥ煙瑙f瀽榪愮畻絎?::)鎴栬呮垚鍛樿闂繍綆楃(.鎴栬?font face="Courier New">->)銆備緥濡傦細(xì)this->count鏄檺瀹氬悕錛岃宑ount涓嶆槸錛堝敖綆ount鏈夊彲鑳芥槸鏌愪釜綾葷殑鎴愬憳錛夈?br />2銆佷緷璧栧悕錛氬悕瀛椾緷璧栦簬妯℃澘鍙傛暟銆備緥濡傦細(xì)std::vector<T>::iterator錛屽鏋淭鏄ā鏉垮弬鏁幫紝iterator灝辨槸渚濊禆鍚嶏紱濡傛灉T鏄凡鐭ョ被鍨嬶紙姣斿int錛夛紝iterator灝辨槸闈炰緷璧栧悕銆?br />
琛ㄦ牸聽(tīng)9.1.聽(tīng)鍚嶅瓧鍒嗙被瀛?(絎竴閮ㄥ垎)

鍒嗙被

娉ㄩ噴

鏍囪瘑絎?/p>

鐢卞瓧絎︺佷笅鍒掔嚎(_)鍜屾暟瀛楃粍鎴愮殑鍚嶅瓧錛屼笉鑳戒互鏁板瓧寮澶淬傛湁涓浜涙爣璇嗙鏄繚鐣欑殑錛屼綘涓嶈兘鍦ㄨ嚜宸辯▼搴忎腑寮曞叆瀹冧滑(涓縐嶉伩鍏嶅紩鍏ョ殑絎ㄦ柟娉曟槸浠鎴栬卂_浣滀負(fù)鍓嶇紑)銆傚瓧絎︾殑姒傚康寰堝箍娉涳紝鍖呮嫭瀵歸潪瀛楁瘝璇█緙栫爜鐨勭壒孌婂瓧絎︺?/p>

鎿嶄綔絎︾被

鍏抽敭瀛梠perator 鍚庨潰璺熺潃涓涓鍙楓備緥濡俹perator new鍜宱perator []銆傚緢澶氭搷浣滅閮芥槸澶氫箟鐨勶紝渚嬪operator &鍙互鏄寜浣嶄笌榪愮畻錛屼篃鍙互鏄彇鍦板潃榪愮畻銆?/p>

杞崲綾?/p>

鎸囩ず鐢ㄦ埛瀹氫箟鐨勯殣寮忕被鍨嬭漿鎹€備緥濡俹perator int&錛屾垜浠彲浠ユ妸瀹冭漿鎹㈡垚int綾誨瀷鐨勪綅涓庢搷浣?/p>

妯℃澘綾?/p>

template鍚庨潰璺熺潃<>錛岄噷闈㈡槸妯℃澘鍙傛暟銆備緥濡侺ist<T, int, 0>(涓ユ牸璁詫紝C++鏍囧噯鍙厑璁哥畝鍗曠殑鏍囪瘑絎︿負(fù)妯℃澘鍚嶏紝鎴栬鏈変簤璁鎿嶄綔絎︾被涔熸槸鍏佽鐨勶紱渚嬪錛歰perator+<X<int> >)銆?/p>

闈為檺瀹氱被

鏇翠竴鑸殑鏍囪瘑絎︺傚彲浠ユ槸涓婇潰鍑犵被(鏍囪瘑絎︺佹搷浣滅綾匯佽漿鎹㈢被鎴栨ā鏉跨被)鎴栬呮槸鏋愭瀯鍚?渚嬪錛屽儚~Data聽(tīng)鎴?~List<T, T, N>涔嬬被鐨?/tt>絎﹀彿)銆?/font>

闄愬畾綾?/p>

闈為檺瀹氱被鍓嶉潰鍔犱笂綾繪垨鑰呭悕瀛楃┖闂撮檺瀹氾紝鎴栬呭叏灞浣滅敤鍩熻В鏋愯繍綆楃銆傛敞鎰忎竴涓悕瀛楁湰韜彲浠ユ槸闄愬畾鐨勶紝渚嬪::X, S::x, Array<T>::y, and ::N::A<T>::z銆?/tt>

闄愬畾鍚?/p>

榪欎釜鍚嶈瘝鍦ㄦ爣鍑嗕腑鏄病鏈夌殑錛屾垜浠敤瀹冩潵琛ㄧず鎵ц闄愬畾鏌ユ壘鐨勫悕瀛椼傜壒瀹氭儏鍐典笅錛屽氨鏄檺瀹氭爣璇嗘垨鑰呭湪闈為檺瀹氭爣璇嗗墠闈㈡樉寮忎嬌鐢ㄦ垚鍛樿闂繍綆楃(.聽(tīng)鎴栬?->)銆備緥濡係::x, this->f,聽(tīng)鍜?p->A::m銆傜劧鑰岋紝闄や簡(jiǎn)class_mem 鍜宼his->class_mem鍦ㄤ笂涓嬫枃鐜涓槸絳夊悓鐨勬儏鍐典笅涓嶉渶瑕侀檺瀹氬悕錛屽叾浠栨儏鍐典笅蹇呴』鏄懼紡浣跨敤鎴愬憳璁塊棶榪愮畻絎︺?/tt>

闈為檺瀹氬悕

闈為檺瀹氭爣璇嗕笉鏄潪闄愬畾鍚嶃傝繖涔熶笉鏄竴涓爣鍑嗕腑鐨勬湳璇紝浣嗘槸鐩稿綋浜庢墽琛岄潪闄愬畾鏌ユ壘涓殑鍚嶅瓧銆?/p>


琛ㄦ牸聽(tīng)9.2. 鍚嶅瓧鍒嗙被瀛?(絎簩閮ㄥ垎)

鍒嗙被

娉ㄩ噴

鍚嶅瓧

闄愬畾鎴栬呴潪闄愬畾鐨勫悕瀛椼?/p>

渚濊禆鍚?/p>

鍚嶅瓧渚濊禆浜庢ā鏉垮弬鏁般備換浣曞惈鏈夋ā鏉垮弬鏁扮殑闄愬畾鎴栬呴潪闄愬畾鍚嶅瓧閮芥槸渚濊禆鍚嶃傛澶栵紝鎴愬憳璁塊棶鎿嶄綔絎?.鎴?tt>->) 淇グ鐨勯檺瀹氬悕 錛屽鏋滄搷浣滅宸﹁竟鐨勮〃杈懼紡綾誨瀷渚濊禆浜庢ā鏉垮弬鏁幫紝閭d箞榪欎釜闄愬畾鍚嶆槸渚濊禆鐨勩傚挨鍏惰繖縐嶆儏鍐碉細(xì)this->b涓殑b鍦ㄦā鏉夸腑渚挎槸渚濊禆鍚嶃傛渶鍚庯紝ident(x, y, z)璋冪敤褰㈠紡涓殑ident褰撲笖浠呭綋鍙傛暟琛ㄨ揪寮忎腑鏈夌被鍨嬩緷璧栦簬妯℃澘鍙傛暟銆?/font>

闈炰緷璧栧悕

涓嶇鍚堜笂闈㈡弿榪扮殑鍚嶅瓧灝變笉鏄緷璧栧悕銆?/p>


涓婇潰榪欎簺鍚嶈瘝閫氬父鐢ㄦ潵鎻忚堪C++妯℃澘涓殑闂錛岄氳涓杈規(guī)槸寰堟湁鐢ㄧ殑錛屾垜浠彲浠ョ啛鎮(zhèn)夎繖浜涘悕璇嶏紝浣嗘病鏈夊繀瑕佽浣忔瘡涓悕璇嶇‘鍒囩殑鎰忔濄傞渶瑕佺殑鏃跺欙紝鎴戜滑鍙互閫氳繃绱㈠紩寰堝鏄撶殑鏌ラ槄銆?img src ="http://www.shnenglu.com/wlwlxj/aggbug/5169.html" width = "1" height = "1" />

]]>
C++ Template: The Complete Guide 瀛︿範(fàn)錛?.5鍚庤http://www.shnenglu.com/wlwlxj/archive/2006/04/07/5157.html涓囪繛鏂?/dc:creator>涓囪繛鏂?/author>Fri, 07 Apr 2006 14:24:00 GMThttp://www.shnenglu.com/wlwlxj/archive/2006/04/07/5157.htmlhttp://www.shnenglu.com/wlwlxj/comments/5157.htmlhttp://www.shnenglu.com/wlwlxj/archive/2006/04/07/5157.html#Feedback0http://www.shnenglu.com/wlwlxj/comments/commentRss/5157.htmlhttp://www.shnenglu.com/wlwlxj/services/trackbacks/5157.html8.5 鍚庤
鑷?0騫翠唬鍚庢湡寮曞叆C++妯℃澘錛屽叾姒傚康鍜岃娉曚竴鐩翠繚鎸佺浉瀵圭ǔ瀹氥傜被妯℃澘銆佸嚱鏁版ā鏉夸互鍙?qiáng)绫诲瀷鍙傛暟銆傞潪綾誨瀷鍙傛暟鏄ā鏉挎渶鍩虹鐨勫伐鍏楓?br />
鐒惰岋紝鍦ㄦ渶鍒濊璁$殑鍩虹涓婅繕鏄坊鍔犱簡(jiǎn)涓浜涘唴瀹癸紝澶ч儴鍒嗘槸C++鏍囧噯搴撶殑闇瑕併傛垚鍛樻ā鏉挎槸娣誨姞鍐呭涓渶鍩烘湰鐨勩傚緢濂囨紝鍙湁鎴愬憳鍑芥暟妯℃澘琚寮忕撼鍏++鏍囧噯錛屾垚鍛樼被妯℃澘鎴愪負(fù)鏍囧噯鐨勪竴閮ㄥ垎榪樺瓨鍦ㄤ簤璁?br />
鍙嬪厓妯℃澘銆佺己鐪佹ā鏉垮弬鏁板拰妯℃澘妯℃澘鍙傛暟閮芥槸鏈榪戞墠娣誨姞榪涜璦涓殑銆傚0鏄庢ā鏉挎ā鏉垮弬鏁版湁鏃跺欑О浣滈珮綰ф硾鎬э紝瀹冧滑鏈鍒濊寮曞叆鍦–++鏍囧噯搴撲腑鎻愪緵涓縐嶅垎閰嶅櫒妯″瀷錛屽悗鏉ヨ繖縐嶅垎閰嶅櫒妯″瀷琚叾瀹冧笉渚濊禆妯℃澘妯℃澘鍙傛暟鎵鏇夸唬銆傜敱浜庢ā鏉挎ā鏉垮弬鏁拌鏍艱鏄庡埌鏍囧噯鍖栬繘紼嬪悗鏈熶粛涓嶅畬鍠勶紝鍑犱箮瑕佽浠庤璦涓墧闄ゃ傛渶緇堢敱浜嶤++鏍囧噯濮斿憳?shù)細(xì)澶ч儴鍒嗘垚鍛樿禐鎴愪繚鐣欎笅鏉ヲq跺畬鎴愪簡(jiǎn)瑙勬牸璇存槑銆?img src ="http://www.shnenglu.com/wlwlxj/aggbug/5157.html" width = "1" height = "1" />

涓囪繛鏂?/a> 2006-04-07 22:24 鍙戣〃璇勮
]]>C++ Template: The Complete Guide 瀛︿範(fàn)錛?.4鍙嬪厓http://www.shnenglu.com/wlwlxj/archive/2006/04/06/5119.html涓囪繛鏂?/dc:creator>涓囪繛鏂?/author>Thu, 06 Apr 2006 15:48:00 GMThttp://www.shnenglu.com/wlwlxj/archive/2006/04/06/5119.htmlhttp://www.shnenglu.com/wlwlxj/comments/5119.htmlhttp://www.shnenglu.com/wlwlxj/archive/2006/04/06/5119.html#Feedback0http://www.shnenglu.com/wlwlxj/comments/commentRss/5119.htmlhttp://www.shnenglu.com/wlwlxj/services/trackbacks/5119.html
8.4 鍙嬪厓
澹版槑鍙嬪厓鐨勬濇兂鍏跺疄寰堢畝鍗曪細(xì)鏍囪瘑涓涓被鎴栬呭嚱鏁幫紝瀵逛簬灝嗗叾澹版槑涓哄弸鍏冩墍鍦ㄧ殑綾誨叿鏈夋煇縐嶇壒鏉冦備絾鏄湪浠ヤ笅涓や釜鏂歸潰錛岄棶棰樹(shù)技涔庢湁鐐瑰鏉傦細(xì)
1銆佷竴涓弸鍏冨0鏄庡彧鑳芥槸涓涓疄浣撶殑鍞竴澹版槑錛堟敞錛氭垜榪樻病鐞嗚В錛屼笉鑳借В閲婏級(jí)
2銆佸弸鍏冨嚱鏁板0鏄庣殑鍚屾椂鍙互瀹氫箟銆?br />
鍙嬪厓綾誨湪澹版槑鐨勬椂鍊欎笉鍏佽瀹氫箟錛屾墍浠ヤ竴鑸笉浼?xì)鏈夐棶棰樸傚湪妯℃澘鎯呭喌涓嬶紝鍞竴涓鐐逛笉鍚屽氨鏄彲浠ュ皢綾繪ā鏉跨殑涓涓壒瀹氬疄渚嬪0鏄庝負(fù)鍙嬪厓錛?br />
template<typename聽(tīng)T>
class聽(tīng)Node;

template
<typename聽(tīng)T>
class聽(tīng)Tree{
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
class聽(tīng)Node<T>;
聽(tīng)聽(tīng)聽(tīng)聽(tīng)鈥?br />}
;
娉ㄦ剰錛氱被妯℃澘鍦ㄨ涓涓被鎴栬呯被妯℃澘澹版槑涓哄弸鍏冪殑鏃跺欏繀欏繪槸鍙鐨勶紝鑰屽浜庢櫘閫氱殑綾誨垯娌℃湁榪欑闇姹傦細(xì)
template<typename聽(tīng)T>
class聽(tīng)Tree{聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
class聽(tīng)Factory;聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)//聽(tīng)OK,聽(tīng)even聽(tīng)if聽(tīng)first聽(tīng)declaration聽(tīng)of聽(tīng)Factory
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)class聽(tīng)class聽(tīng)Node<T>;聽(tīng)聽(tīng)//聽(tīng)ERROR聽(tīng)if聽(tīng)Node聽(tīng)isn't聽(tīng)visible
}
;聽(tīng)

8.4.1 鍙嬪厓鍑芥暟
鍑芥暟妯℃澘鐨勫疄渚嬪彲浠ラ氳繃鍦ㄥ嚱鏁板悕鍚庨潰璺熶竴瀵?lt;>灝嗗叾澹版槑涓哄弸鍏冦?lt;>閲岄潰鍙互鍖呭惈妯℃澘鍙傛暟錛屽鏋滅紪璇戝櫒鍙互鎺ㄥ鍑烘ā鏉垮弬鏁幫紝鍙互鐪佺暐璋冩ā鏉垮弬鏁幫細(xì)
template<typename聽(tīng)T1,聽(tīng)typename聽(tīng)T2>
void聽(tīng)combine(T1,聽(tīng)T2);

class聽(tīng)Mixer{
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
void聽(tīng)combine<>(int&,聽(tīng)int&);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//聽(tīng)OK:聽(tīng)T1聽(tīng)=聽(tīng)int&,聽(tīng)T2聽(tīng)=聽(tīng)int&
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)void聽(tīng)combine<int,聽(tīng)int>(int,聽(tīng)int);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//聽(tīng)OK:聽(tīng)T1聽(tīng)=聽(tīng)int,聽(tīng)T2聽(tīng)=聽(tīng)int
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)void聽(tīng)combine<char>(char,聽(tīng)int);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//聽(tīng)OK:聽(tīng)T1聽(tīng)=聽(tīng)char聽(tīng)T2聽(tīng)=聽(tīng)int
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)void聽(tīng)combine<char>(char&,聽(tīng)int);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//聽(tīng)ERROR:聽(tīng)doesn't聽(tīng)match聽(tīng)combine()聽(tīng)template
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)void聽(tīng)combine<>(long,聽(tīng)long)聽(tīng){聽(tīng)}
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
//聽(tīng)ERROR:聽(tīng)definition聽(tīng)not聽(tīng)allowed!
}
;
錛堟敞錛氬湪GCC涓嬫祴璇曪紝VS2003涓嶈錛?br />娉ㄦ剰錛氭垜浠彲浠ュ妯℃澘榪涜涓撻棬鍖栧畾涔夛紝浣嗘槸涓嶈兘瀵規(guī)ā鏉垮疄渚嬭繘琛屽畾涔夛紝鎵浠ュ0鏄庢ā鏉垮疄渚嬩負(fù)鍙嬪厓鏃朵笉鑳藉畾涔夈?br />
濡傛灉鍚嶅瓧鍚庨潰璺熸湁<>錛屾湁2縐嶅彲鑳斤細(xì)
1銆佸鏋滃悕瀛楁病鏈夐檺瀹氳瘝錛堜篃灝辨槸鍓嶉潰娌℃湁::錛夛紝灝變笉鍙兘鏄ā鏉垮疄渚嬨傚鏋滃湪澹版槑鍙嬪厓鐨勫湴鏂規(guī)病鏈夐潪妯℃澘鍑芥暟鍖歸厤鐨勮瘽錛屽氨鏄嚱鏁扮殑棣栨澹版槑錛屽0鏄庡悓鏃跺彲浠ュ畾涔夈?br />2銆佸鏋滃悕瀛楁湁闄愬畾璇嶏紝閭d箞涓瀹氫笌鍓嶉潰澹版槑鐨勫嚱鏁版垨鑰呮ā鏉垮嚱鏁版湁鍏籌紝鍦ㄥ尮閰嶇殑鏃跺欎紭鍏堥夋嫨闈炲嚱鏁版ā鏉胯屼笉鏄嚱鏁版ā鏉匡紝鐒惰屽湪澹版槑鐨勬椂鍊欐槸涓嶅厑璁稿畾涔夌殑銆?br />
涓嬮潰鐨勪緥瀛愭葷粨浜?jiǎn)鍚効U嶅彲鑳芥э細(xì)
void聽(tīng)multiply聽(tīng)(void*);聽(tīng)聽(tīng)聽(tīng)//聽(tīng)ordinary聽(tīng)function聽(tīng)

template聽(tīng)
<typename聽(tīng)T>聽(tīng)
void聽(tīng)multiply(T);聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)//聽(tīng)function聽(tīng)template聽(tīng)

class聽(tīng)Comrades聽(tīng){聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
void聽(tīng)multiply(int)聽(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)defines聽(tīng)a聽(tīng)new聽(tīng)function聽(tīng)::multiply(int)聽(tīng)

聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
void聽(tīng)::multiply(void*);聽(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)refers聽(tīng)to聽(tīng)the聽(tīng)ordinary聽(tīng)function聽(tīng)above;聽(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)not聽(tīng)to聽(tīng)the聽(tīng)multiply<void*>聽(tīng)instance聽(tīng)

聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
void聽(tīng)::multiply(int);聽(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)refers聽(tīng)to聽(tīng)an聽(tīng)instance聽(tīng)of聽(tīng)the聽(tīng)template聽(tīng)

聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
void聽(tīng)::multiply<double*>(double*);聽(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)qualified聽(tīng)names聽(tīng)can聽(tīng)also聽(tīng)have聽(tīng)angle聽(tīng)brackets聽(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)but聽(tīng)a聽(tīng)template聽(tīng)must聽(tīng)be聽(tīng)visible.聽(tīng)

聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
void聽(tīng)::error()聽(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)ERROR:聽(tīng)a聽(tīng)qualified聽(tīng)friend聽(tīng)cannot聽(tīng)be聽(tīng)a聽(tīng)definition聽(tīng)
}
;聽(tīng)

錛堟敞錛氬湪VS2003鍜岃鍒欏鍚堬紝GCC涓婄紪璇戝畬鍏ㄩ氳繃錛?br />
鍓嶉潰渚嬪瓙鎴戜滑璁ㄨ浜?jiǎn)涓鑸被錛堢浉瀵逛簬綾繪ā鏉匡級(jí)閲岄潰鐨勫弸鍏冨嚱鏁幫紝閬靛畧鐨勮鍒欏悓鏍烽傜敤浜庣被妯℃澘錛屼絾妯℃澘鍙傛暟鍦ㄧ‘瀹氬弸鍏冨嚱鏁扮殑鏃跺欎細(xì)璧蜂綔鐢細(xì)
template<typename聽(tīng)T>
class聽(tīng)Node聽(tīng){
聽(tīng)聽(tīng)聽(tīng)聽(tīng)Node
<T>*聽(tīng)allocate();
}
;聽(tīng)

template
<typename聽(tīng)T>
class聽(tīng)List聽(tīng){
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)Node
<T>*聽(tīng)Node<T>::allocate();
}
;

鐒惰岋紝褰撳弸鍏冨嚱鏁板湪綾繪ā鏉塊噷闈㈠0鏄庡茍瀹氫箟鐨勬椂鍊欎細(xì)鍑虹幇鏈夎叮鐨勭幇璞★紝鍥犱負(fù)妯℃澘閲岄潰浠諱綍涓滆タ鍦ㄦ湭瀹炰緥鍖栦箣鍓嶉兘鍙槸澹版槑鑰屾病鏈夊叿鐜般傝冭檻涓嬮潰鐨勪緥瀛愶細(xì)
template<typename聽(tīng)T>
class聽(tīng)Creator聽(tīng){聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
void聽(tīng)appear()聽(tīng){聽(tīng)聽(tīng)//聽(tīng)a聽(tīng)new聽(tīng)function聽(tīng)::appear(),聽(tīng)but聽(tīng)it聽(tīng)doesn't
聽(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)?/span>//聽(tīng)exist聽(tīng)until聽(tīng)Creator聽(tīng)is聽(tīng)instantiated
聽(tīng)聽(tīng)聽(tīng)聽(tīng)}

}
;

Creator
<void>聽(tīng)miracle;聽(tīng)聽(tīng)//聽(tīng)::appear()聽(tīng)is聽(tīng)created聽(tīng)at聽(tīng)this聽(tīng)point
Creator<double>聽(tīng)oops;聽(tīng)聽(tīng)聽(tīng)//聽(tīng)ERROR:聽(tīng)::appear()聽(tīng)is聽(tīng)created聽(tīng)a聽(tīng)second聽(tīng)time!
榪欎釜渚嬪瓙涓ā鏉跨殑涓ゆ瀹炰緥鍖栧鑷村悓涓鍑芥暟瀹氫箟澶氭錛岃繚鍙嶄簡(jiǎn)涓嬈″畾涔夎鍒欍?br />
鎵浠ュ浜庝笂闈㈢殑鎯呭喌錛屾垜浠繀欏葷‘淇濈被妯℃澘鐨勬ā鏉垮弬鏁板嚭鐜板湪澹版槑騫跺畾涔夌殑鍙嬪厓鍑芥暟褰㈠弬閲岄潰錛堥櫎闈炴兂闃繪澶氭瀹炰緥鍖栦竴涓被妯℃澘錛岃繖濂藉儚涓嶅お鍙兘錛夈傛妸榪欎釜瑙勫緥榪愮敤鍒板墠闈㈤偅涓緥瀛愶細(xì)
template<typename聽(tīng)T>
class聽(tīng)Creator聽(tīng){聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
void聽(tīng)feed(Creator<T>*){聽(tīng)聽(tīng)//聽(tīng)every聽(tīng)T聽(tīng)generates聽(tīng)a聽(tīng)different
聽(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)function聽(tīng)::feed()
聽(tīng)聽(tīng)聽(tīng)聽(tīng)}

}
;

Creator
<void>聽(tīng)one;聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)//聽(tīng)generates聽(tīng)::feed(Creator<void>*)
Creator<double>聽(tīng)two;聽(tīng)聽(tīng)聽(tīng)//聽(tīng)generates聽(tīng)::feed(Creator<double>*)
榪欎釜渚嬪瓙涓紝Creator姣忎釜瀹炰緥閮界敓鎴愪笉鍚岀殑鍑芥暟銆傛敞鎰忚繖浜涘嚱鏁版槸綾繪ā鏉垮疄渚嬩駭鐢熺殑錛屼絾鍑芥暟鏈韓騫朵笉鏄嚱鏁版ā鏉跨殑瀹炰緥錛岃屾槸鏅氬嚱鏁般?br />榪樿娉ㄦ剰榪欎簺鍑芥暟浣撳畾涔変簬綾諱腑錛岄粯璁ゆ槸鍐呰仈鐨勶紝鎵浠ュ湪涓や釜緲昏瘧鍗曞厓浜х敓鐩稿悓鐨勫嚱鏁版槸娌℃湁闂鐨勩傦紙娉細(xì)鐢變簬鍐呰仈鍑芥暟鍩轟簬浠g爜鏇夸唬鎶鏈紝鎵浠ヤ竴涓嚱鏁板畾涔夋墍鍦ㄧ殑h鏂囦歡琚嬈″寘鍚笉浼?xì)鏈夐棶棰樺Q屽唴鑱斿嚱鏁板湪緙栬瘧鍣ㄧ湅鏉ュ氨鏄竴孌典唬鐮併傦級(jí)

8.4.2 鍙嬪厓妯℃澘
涓鑸儏鍐墊垜浠兘鏄妸鍑芥暟妯℃澘鎴栬呯被妯℃澘鐨勬煇涓瀹炰緥澹版槑涓哄弸鍏冿紝浣嗘妸妯℃澘鏈韓澹版槑涓哄弸鍏冩湁鏃跺欎篃鏄潪甯告湁鐢ㄧ殑銆傝繖灝遍渶瑕佹墍璋撶殑妯℃澘鍙嬪厓錛屼緥濡傦細(xì)
class聽(tīng)Manager聽(tīng){聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)template
<typename聽(tīng)T>
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
class聽(tīng)Task;
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)template
<typename聽(tīng)T>
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
void聽(tīng)Schedule<T>::dispatch(Task<T>*);
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)template
<typename聽(tīng)T>
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)
int聽(tīng)ticket()聽(tīng){
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)
return聽(tīng)++Manager::counter;
聽(tīng)聽(tīng)聽(tīng)聽(tīng)}
聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
static聽(tīng)int聽(tīng)counter;
}
;
鍜屾櫘閫氬弸鍏冨嚱鏁頒竴鏍鳳紝娌℃湁闄愬畾璇嶄笖鍚嶅瓧鍚庨潰娌℃湁<>鐨勫嚱鏁版ā鏉垮湪澹版槑涓哄弸鍏冨悓鏃跺彲浠ュ畾涔夈?br />澹版槑鍘熷鍑芥暟妯℃澘鎴栬呭師濮嬬被妯℃澘涓哄弸鍏冪殑鏃跺欙紝鎵鏈夌浉鍏崇殑鍋忕壒鍖栦互鍙?qiáng)鏄窘C虹壒渚嬪寲閮借嚜鍔ㄦ垚涓哄弸鍏冦?br />錛堟敞錛氭祴璇曚唬鐮?br />
class聽(tīng)Manager聽(tīng){聽(tīng)
聽(tīng)聽(tīng)聽(tīng)聽(tīng)template
<typename聽(tīng)T>聽(tīng)聽(tīng)聽(tīng)聽(tīng)//聽(tīng)firend聽(tīng)template
聽(tīng)聽(tīng)聽(tīng)聽(tīng)friend聽(tīng)class聽(tīng)Task;
private:
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
int聽(tīng)聽(tīng)聽(tīng)聽(tīng)_dat;
}
;

template
<typename聽(tīng)T>
class聽(tīng)Task聽(tīng){
}
;

template
<>
class聽(tīng)Task<int>聽(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)specialization
public:
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
void聽(tīng)accessData()
聽(tīng)聽(tīng)聽(tīng)聽(tīng)
{
聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)_manager._dat聽(tīng)
=聽(tīng)0;聽(tīng)聽(tīng)聽(tīng)聽(tīng)//聽(tīng)can聽(tīng)access聽(tīng)Manager's聽(tīng)private聽(tīng)data
聽(tīng)聽(tīng)聽(tīng)聽(tīng)}

private:
聽(tīng)聽(tīng)聽(tīng)聽(tīng)Manager聽(tīng)聽(tīng)聽(tīng)聽(tīng)_manager;
}
;

錛?br />(鏈妭瀹岋紝姹?..... 鑷繁鏀惰幏涓嶅皬)

]]>
鑳界敓鎴愯繖涓被鐨勪竴涓璞″槢錛燂紵錛?/title><link>http://www.shnenglu.com/wlwlxj/archive/2006/04/05/5052.html</link><dc:creator>涓囪繛鏂?/dc:creator><author>涓囪繛鏂?/author><pubDate>Wed, 05 Apr 2006 15:24:00 GMT</pubDate><guid>http://www.shnenglu.com/wlwlxj/archive/2006/04/05/5052.html</guid><wfw:comment>http://www.shnenglu.com/wlwlxj/comments/5052.html</wfw:comment><comments>http://www.shnenglu.com/wlwlxj/archive/2006/04/05/5052.html#Feedback</comments><slash:comments>12</slash:comments><wfw:commentRss>http://www.shnenglu.com/wlwlxj/comments/commentRss/5052.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/wlwlxj/services/trackbacks/5052.html</trackback:ping><description><![CDATA[涓嶈皥閫傜敤鎬э紝綰補(bǔ)璇硶涓婂疄鐜幫紝鎴戣嚜宸辨棤鑳戒負(fù)鍔涖?br /><br /><div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /><span style="COLOR: #000000">template</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">typename聽(tīng)T,聽(tīng)template</span><span style="COLOR: #000000"><</span><span style="COLOR: #000000">T聽(tīng)a</span><span style="COLOR: #000000">></span><span style="COLOR: #000000">聽(tīng)</span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)T2</span><span style="COLOR: #000000">></span><span style="COLOR: #000000"><br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /></span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000">聽(tīng)TmTm<br /><img id="Codehighlighter1_56_58_Open_Image" onclick="this.style.display='none'; Codehighlighter1_56_58_Open_Text.style.display='none'; Codehighlighter1_56_58_Closed_Image.style.display='inline'; Codehighlighter1_56_58_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_56_58_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_56_58_Closed_Text.style.display='none'; Codehighlighter1_56_58_Open_Image.style.display='inline'; Codehighlighter1_56_58_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span><span id="Codehighlighter1_56_58_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_56_58_Open_Text"><span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span></span><span style="COLOR: #000000">;</span></div><img src ="http://www.shnenglu.com/wlwlxj/aggbug/5052.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/wlwlxj/" target="_blank">涓囪繛鏂?/a> 2006-04-05 23:24 <a href="http://www.shnenglu.com/wlwlxj/archive/2006/04/05/5052.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>涓涓ā鏉垮閥濡欐妧鏈紝璇硶鎶宸?/title><link>http://www.shnenglu.com/wlwlxj/archive/2006/04/05/5051.html</link><dc:creator>涓囪繛鏂?/dc:creator><author>涓囪繛鏂?/author><pubDate>Wed, 05 Apr 2006 14:26:00 GMT</pubDate><guid>http://www.shnenglu.com/wlwlxj/archive/2006/04/05/5051.html</guid><wfw:comment>http://www.shnenglu.com/wlwlxj/comments/5051.html</wfw:comment><comments>http://www.shnenglu.com/wlwlxj/archive/2006/04/05/5051.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.shnenglu.com/wlwlxj/comments/commentRss/5051.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/wlwlxj/services/trackbacks/5051.html</trackback:ping><description><![CDATA[ <p>鐮旂┒Boost鍓嶏紝鎯蟲(chóng)繁鍏ヤ簡(jiǎn)瑙d竴涓嬫ā鏉挎妧鏈紝鎵炬潵涓鏈功銆奀++ Template:The Complete Guide銆嬬爺絀躲?br />閲岄潰鏈夎繖鏍蜂竴涓皬鎶宸э紝鍒ゆ柇涓涓被涓槸鍚︽湁鏌愮綾誨艦銆備笅闈㈡槸浠g爜錛?Win 2K+ VS2003)<br /></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">#include聽(tīng)</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">iostream</span> <span style="COLOR: #000000">></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> <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">typedef聽(tīng)</span> <span style="COLOR: #0000ff">char</span> <span style="COLOR: #000000">聽(tīng)RT1;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" />typedef聽(tīng)</span> <span style="COLOR: #0000ff">struct</span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_71_85_Open_Image" onclick="this.style.display='none'; Codehighlighter1_71_85_Open_Text.style.display='none'; Codehighlighter1_71_85_Closed_Image.style.display='inline'; Codehighlighter1_71_85_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_71_85_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_71_85_Closed_Text.style.display='none'; Codehighlighter1_71_85_Open_Image.style.display='inline'; Codehighlighter1_71_85_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span id="Codehighlighter1_71_85_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_71_85_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)</span> <span style="COLOR: #0000ff">char</span> <span style="COLOR: #000000">聽(tīng)a[</span> <span style="COLOR: #000000">2</span> <span style="COLOR: #000000">];<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000">聽(tīng)RT2;<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> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽(tīng)閫夋嫨榪欎釜鐗堟湰灝嗚繑鍥瀋har,澶у皬涓?</span> <span style="COLOR: #008000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000">template</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">typename聽(tīng)T</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">聽(tīng)RT1聽(tīng)test(typename聽(tīng)T::X聽(tīng)</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">)<br /><img id="Codehighlighter1_167_193_Open_Image" onclick="this.style.display='none'; Codehighlighter1_167_193_Open_Text.style.display='none'; Codehighlighter1_167_193_Closed_Image.style.display='inline'; Codehighlighter1_167_193_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_167_193_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_167_193_Closed_Text.style.display='none'; Codehighlighter1_167_193_Open_Image.style.display='inline'; Codehighlighter1_167_193_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_167_193_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_167_193_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)</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)dumy聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">0</span> <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)dumy</span> <span style="COLOR: #000000">++</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> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽(tīng)閫夋嫨榪欎釜鐗堟湰灝嗚繑鍥瀋har,澶у皬涓?</span> <span style="COLOR: #008000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000">template</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">typename聽(tīng)T</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">聽(tīng)RT2聽(tīng)test(<img src="http://www.shnenglu.com/images/dot.gif" />)<br /><img id="Codehighlighter1_253_279_Open_Image" onclick="this.style.display='none'; Codehighlighter1_253_279_Open_Text.style.display='none'; Codehighlighter1_253_279_Closed_Image.style.display='inline'; Codehighlighter1_253_279_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_253_279_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_253_279_Closed_Text.style.display='none'; Codehighlighter1_253_279_Open_Image.style.display='inline'; Codehighlighter1_253_279_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_253_279_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_253_279_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)</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)dumy聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">0</span> <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)dumy</span> <span style="COLOR: #000000">++</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> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽(tīng)渚濋潬緙栬瘧鍣ㄨ嚜鍔ㄩ夋嫨test鍑芥暟,鐒跺悗渚濇嵁榪斿洖綾誨瀷鍒ゆ柇鏄惁鍚湁X</span> <span style="COLOR: #008000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #000000">template</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">typename聽(tīng)T</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">bool</span> <span style="COLOR: #000000">聽(tīng)type_has_member_type_X()<br /><img id="Codehighlighter1_369_441_Open_Image" onclick="this.style.display='none'; Codehighlighter1_369_441_Open_Text.style.display='none'; Codehighlighter1_369_441_Closed_Image.style.display='inline'; Codehighlighter1_369_441_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_369_441_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_369_441_Closed_Text.style.display='none'; Codehighlighter1_369_441_Open_Image.style.display='inline'; Codehighlighter1_369_441_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_369_441_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_369_441_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)</span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽(tīng)(</span> <span style="COLOR: #0000ff">sizeof</span> <span style="COLOR: #000000">(test</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">T</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">(</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">))聽(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">);<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> <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: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)HasX<br /><img id="Codehighlighter1_465_491_Open_Image" onclick="this.style.display='none'; Codehighlighter1_465_491_Open_Text.style.display='none'; Codehighlighter1_465_491_Closed_Image.style.display='inline'; Codehighlighter1_465_491_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_465_491_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_465_491_Closed_Text.style.display='none'; Codehighlighter1_465_491_Open_Image.style.display='inline'; Codehighlighter1_465_491_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_465_491_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_465_491_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">public</span> <span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)X<br /><img id="Codehighlighter1_485_488_Open_Image" onclick="this.style.display='none'; Codehighlighter1_485_488_Open_Text.style.display='none'; Codehighlighter1_485_488_Closed_Image.style.display='inline'; Codehighlighter1_485_488_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_485_488_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_485_488_Closed_Text.style.display='none'; Codehighlighter1_485_488_Open_Image.style.display='inline'; Codehighlighter1_485_488_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 id="Codehighlighter1_485_488_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_485_488_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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> <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: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)NonX<br /><img id="Codehighlighter1_516_542_Open_Image" onclick="this.style.display='none'; Codehighlighter1_516_542_Open_Text.style.display='none'; Codehighlighter1_516_542_Closed_Image.style.display='inline'; Codehighlighter1_516_542_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_516_542_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_516_542_Closed_Text.style.display='none'; Codehighlighter1_516_542_Open_Image.style.display='inline'; Codehighlighter1_516_542_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_516_542_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_516_542_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">public</span> <span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)Y<br /><img id="Codehighlighter1_536_539_Open_Image" onclick="this.style.display='none'; Codehighlighter1_536_539_Open_Text.style.display='none'; Codehighlighter1_536_539_Closed_Image.style.display='inline'; Codehighlighter1_536_539_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_536_539_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_536_539_Closed_Text.style.display='none'; Codehighlighter1_536_539_Open_Image.style.display='inline'; Codehighlighter1_536_539_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 id="Codehighlighter1_536_539_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_536_539_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽(tīng)_tmain(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽(tīng)argc,聽(tīng)_TCHAR</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">聽(tīng)argv[])<br /><img id="Codehighlighter1_583_934_Open_Image" onclick="this.style.display='none'; Codehighlighter1_583_934_Open_Text.style.display='none'; Codehighlighter1_583_934_Closed_Image.style.display='inline'; Codehighlighter1_583_934_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_583_934_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_583_934_Closed_Text.style.display='none'; Codehighlighter1_583_934_Open_Image.style.display='inline'; Codehighlighter1_583_934_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_583_934_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_583_934_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)</span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">聽(tīng)緙栬瘧鍣ㄩ夋嫨閲嶈澆鍑芥暟絳栫暐:閫夋嫨綾誨瀷鏈鍖歸厤鐗堟湰<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: #008000">//</span> <span style="COLOR: #008000">聽(tīng)鍊懼悜浜庢妸0杞寲涓哄父閲忕┖鎸囬拡,鎵浠ラ夋嫨榪斿洖涓篟T1鐗堟湰</span> <span style="COLOR: #008000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span> <span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000">(type_has_member_type_X</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">HasX</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">())<br /><img id="Codehighlighter1_679_719_Open_Image" onclick="this.style.display='none'; Codehighlighter1_679_719_Open_Text.style.display='none'; Codehighlighter1_679_719_Closed_Image.style.display='inline'; Codehighlighter1_679_719_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_679_719_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_679_719_Closed_Text.style.display='none'; Codehighlighter1_679_719_Open_Image.style.display='inline'; Codehighlighter1_679_719_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 id="Codehighlighter1_679_719_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_679_719_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)聽(tīng)聽(tīng)聽(tīng)std::cout聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Has聽(tīng)X</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)std::endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)}</span> </span> <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)</span> <span style="COLOR: #0000ff">else</span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_728_768_Open_Image" onclick="this.style.display='none'; Codehighlighter1_728_768_Open_Text.style.display='none'; Codehighlighter1_728_768_Closed_Image.style.display='inline'; Codehighlighter1_728_768_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /> <img id="Codehighlighter1_728_768_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_728_768_Closed_Text.style.display='none'; Codehighlighter1_728_768_Open_Image.style.display='inline'; Codehighlighter1_728_768_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 id="Codehighlighter1_728_768_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_728_768_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)聽(tīng)聽(tīng)聽(tīng)std::cout聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Non聽(tīng)X</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)std::endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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: #008000">//</span> <span style="COLOR: #008000">聽(tīng)娌℃湁T::X,鎵浠ラ夋嫨榪斿洖涓篟T2鐗堟湰</span> <span style="COLOR: #008000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /> </span> <span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">if</span> <span style="COLOR: #000000">(type_has_member_type_X</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">NonX</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000">())<br /><img id="Codehighlighter1_832_872_Open_Image" onclick="this.style.display='none'; Codehighlighter1_832_872_Open_Text.style.display='none'; Codehighlighter1_832_872_Closed_Image.style.display='inline'; Codehighlighter1_832_872_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_832_872_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_832_872_Closed_Text.style.display='none'; Codehighlighter1_832_872_Open_Image.style.display='inline'; Codehighlighter1_832_872_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 id="Codehighlighter1_832_872_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_832_872_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)聽(tīng)聽(tīng)聽(tīng)std::cout聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Has聽(tīng)X</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)std::endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)}</span> </span> <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)</span> <span style="COLOR: #0000ff">else</span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_881_921_Open_Image" onclick="this.style.display='none'; Codehighlighter1_881_921_Open_Text.style.display='none'; Codehighlighter1_881_921_Closed_Image.style.display='inline'; Codehighlighter1_881_921_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /> <img id="Codehighlighter1_881_921_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_881_921_Closed_Text.style.display='none'; Codehighlighter1_881_921_Open_Image.style.display='inline'; Codehighlighter1_881_921_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 id="Codehighlighter1_881_921_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_881_921_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)聽(tīng)聽(tīng)聽(tīng)std::cout聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Non聽(tīng)X</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)std::endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)}</span> </span> <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)</span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> </div>杈撳嚭緇撴灉:<br />Has X<br />Non X<img src ="http://www.shnenglu.com/wlwlxj/aggbug/5051.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/wlwlxj/" target="_blank">涓囪繛鏂?/a> 2006-04-05 22:26 <a href="http://www.shnenglu.com/wlwlxj/archive/2006/04/05/5051.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鎶戝埗妯℃澘浠g爜鑶ㄨ儉鐨勪竴縐嶆妧鏈?/title><link>http://www.shnenglu.com/wlwlxj/archive/2006/03/27/4659.html</link><dc:creator>涓囪繛鏂?/dc:creator><author>涓囪繛鏂?/author><pubDate>Mon, 27 Mar 2006 10:54:00 GMT</pubDate><guid>http://www.shnenglu.com/wlwlxj/archive/2006/03/27/4659.html</guid><wfw:comment>http://www.shnenglu.com/wlwlxj/comments/4659.html</wfw:comment><comments>http://www.shnenglu.com/wlwlxj/archive/2006/03/27/4659.html#Feedback</comments><slash:comments>7</slash:comments><wfw:commentRss>http://www.shnenglu.com/wlwlxj/comments/commentRss/4659.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/wlwlxj/services/trackbacks/4659.html</trackback:ping><description><![CDATA[ <p>妯℃澘鏄竴縐嶆簮鐮佸鐢ㄦ妧鏈?鍦ㄦ煇浜涙儏鍐典笅浣跨敤瀹冨彲浠ヤ嬌浠g爜鐪嬭搗鏉ラ潪甯鎬紭闆?钁楀悕鐨刡oost搴撳氨鏄ā鏉垮彂鎵殑鍏歌寖.<br />鐒惰屾ā鏉夸篃瀛樺湪寮婄,澶ч噺浣跨敤妯℃澘鍙兘瀵艱嚧浠g爜鑶ㄨ儉.涓嬮潰浠嬬粛涓縐嶈В鍐崇殑鏂規(guī):</p> <p>鎴戜滑棣栧厛鐪嬩竴孌典竴鑸唬鐮?<br /></p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000">template</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">typename聽(tīng)T</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)Vector<br /><img id="Codehighlighter1_34_169_Open_Image" onclick="this.style.display='none'; Codehighlighter1_34_169_Open_Text.style.display='none'; Codehighlighter1_34_169_Closed_Image.style.display='inline'; Codehighlighter1_34_169_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_34_169_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_34_169_Closed_Text.style.display='none'; Codehighlighter1_34_169_Open_Image.style.display='inline'; Codehighlighter1_34_169_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_34_169_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_34_169_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">public</span> <span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">virtual</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000">聽(tīng)Say()<br /><img id="Codehighlighter1_65_167_Open_Image" onclick="this.style.display='none'; Codehighlighter1_65_167_Open_Text.style.display='none'; Codehighlighter1_65_167_Closed_Image.style.display='inline'; Codehighlighter1_65_167_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_65_167_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_65_167_Closed_Text.style.display='none'; Codehighlighter1_65_167_Open_Image.style.display='inline'; Codehighlighter1_65_167_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 id="Codehighlighter1_65_167_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_65_167_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)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">const</span> <span style="COLOR: #000000">聽(tīng)type_info</span> <span style="COLOR: #000000">&</span> <span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)t聽(tīng)</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">聽(tīng)typeid(T);<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)聽(tīng)std::cout聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Vector<</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)t.name()聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">>::Hello</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)std::endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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> <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">template</span> <span style="COLOR: #000000"><></span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)聽(tīng)Vector</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000">*></span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_212_300_Open_Image" onclick="this.style.display='none'; Codehighlighter1_212_300_Open_Text.style.display='none'; Codehighlighter1_212_300_Closed_Image.style.display='inline'; Codehighlighter1_212_300_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_212_300_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_212_300_Closed_Text.style.display='none'; Codehighlighter1_212_300_Open_Image.style.display='inline'; Codehighlighter1_212_300_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span id="Codehighlighter1_212_300_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_212_300_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">public</span> <span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">virtual</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000">聽(tīng)Say()<br /><img id="Codehighlighter1_243_298_Open_Image" onclick="this.style.display='none'; Codehighlighter1_243_298_Open_Text.style.display='none'; Codehighlighter1_243_298_Closed_Image.style.display='inline'; Codehighlighter1_243_298_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_243_298_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_243_298_Closed_Text.style.display='none'; Codehighlighter1_243_298_Open_Image.style.display='inline'; Codehighlighter1_243_298_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 id="Codehighlighter1_243_298_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_243_298_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)聽(tīng)聽(tīng)聽(tīng)std::cout聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Vector<void*>::Hello</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)std::endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽(tīng)_tmain(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽(tīng)argc,聽(tīng)_TCHAR</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">聽(tīng)argv[])<br /><img id="Codehighlighter1_341_441_Open_Image" onclick="this.style.display='none'; Codehighlighter1_341_441_Open_Text.style.display='none'; Codehighlighter1_341_441_Closed_Image.style.display='inline'; Codehighlighter1_341_441_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_341_441_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_341_441_Closed_Text.style.display='none'; Codehighlighter1_341_441_Open_Image.style.display='inline'; Codehighlighter1_341_441_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_341_441_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_341_441_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)Vector</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">*></span> <span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)pIntVec;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pIntVec.Say();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)Vector</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #0000ff">double</span> <span style="COLOR: #000000">*></span> <span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)pDoubleVec;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pDoubleVec.Say();<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">return</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> </div> <p> <br />杈撳嚭:<br />Vector<int *>::Hello<br />Vector<double *>::Hello<br />浠庤繖閲?鎴戜滑鍙互鐪嬪嚭紼嬪簭鍦ㄨ繍琛岀殑榪囩▼涓敓浜т簡(jiǎn)涓ゅ垎Vector鐨勪唬鐮?int*鍜宒ouble*),灝界榪欓噷鏈夌壒渚嬪寲,鐒惰岀被鍨嬩笉鍖歸厤,緙栬瘧鍣ㄥ湪緙栬瘧榪囩▼涓棤娉曞畾浣嶅埌鐗逛緥鍖栫増鏈?濡傛灉榪欎釜Vector琚互鐢ㄧ殑鍖?鎴戞兂鍗充嬌鏄竴涓腑絳夎妯$殑紼嬪簭涔熷彲鑳借楄垂鎴愬厗瀛楄妭鐨勪唬鐮佹帶浠?</p> <p>鎴戜滑蹇呴』瀵繪壘涓縐嶄腑闂存ˉ姊佷嬌緙栬瘧鍣ㄥ湪緙栬瘧榪囩▼涓畾浣嶅埌void*鐨勭壒渚嬪寲鐗堟湰.鎸夌収妯℃澘閫夋嫨絳栫暐,緙栬瘧鍣ㄦ繪槸閫夋嫨鏈鐗逛緥鍖栫殑妯℃澘,鎴戜滑鍙互閫氳繃涓涓腑闂寸殑妯℃澘鑱旂郴璧蜂笂闈袱涓増鏈殑妯℃澘.涓嬮潰鐪嬩竴孌典唬鐮?<br /></p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #000000">template</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">typename聽(tīng)T</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)Vector<br /><img id="Codehighlighter1_34_115_Open_Image" onclick="this.style.display='none'; Codehighlighter1_34_115_Open_Text.style.display='none'; Codehighlighter1_34_115_Closed_Image.style.display='inline'; Codehighlighter1_34_115_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_34_115_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_34_115_Closed_Text.style.display='none'; Codehighlighter1_34_115_Open_Image.style.display='inline'; Codehighlighter1_34_115_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_34_115_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_34_115_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">public</span> <span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">virtual</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000">聽(tīng)Say()<br /><img id="Codehighlighter1_65_113_Open_Image" onclick="this.style.display='none'; Codehighlighter1_65_113_Open_Text.style.display='none'; Codehighlighter1_65_113_Closed_Image.style.display='inline'; Codehighlighter1_65_113_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_65_113_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_65_113_Closed_Text.style.display='none'; Codehighlighter1_65_113_Open_Image.style.display='inline'; Codehighlighter1_65_113_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 id="Codehighlighter1_65_113_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_65_113_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)聽(tīng)聽(tīng)聽(tīng)std::cout聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Vector::Hello</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)std::endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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> <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">template</span> <span style="COLOR: #000000"><></span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)聽(tīng)Vector</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000">*></span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_158_246_Open_Image" onclick="this.style.display='none'; Codehighlighter1_158_246_Open_Text.style.display='none'; Codehighlighter1_158_246_Closed_Image.style.display='inline'; Codehighlighter1_158_246_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_158_246_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_158_246_Closed_Text.style.display='none'; Codehighlighter1_158_246_Open_Image.style.display='inline'; Codehighlighter1_158_246_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span id="Codehighlighter1_158_246_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_158_246_Open_Text"> <span style="COLOR: #000000">{<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">public</span> <span style="COLOR: #000000">:<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)</span> <span style="COLOR: #0000ff">virtual</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000">聽(tīng)Say()<br /><img id="Codehighlighter1_189_244_Open_Image" onclick="this.style.display='none'; Codehighlighter1_189_244_Open_Text.style.display='none'; Codehighlighter1_189_244_Closed_Image.style.display='inline'; Codehighlighter1_189_244_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_189_244_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_189_244_Closed_Text.style.display='none'; Codehighlighter1_189_244_Open_Image.style.display='inline'; Codehighlighter1_189_244_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 id="Codehighlighter1_189_244_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_189_244_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)聽(tīng)聽(tīng)聽(tīng)std::cout聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">Vector<void*>::Hello</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000"><<</span> <span style="COLOR: #000000">聽(tīng)std::endl;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(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> <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">template</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">typename聽(tīng)T</span> <span style="COLOR: #000000">></span> <span style="COLOR: #000000"> <br /> <img src="http://www.shnenglu.com/images/OutliningIndicators/None.gif" align="top" /> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000">聽(tīng)Vector</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #000000">T</span> <span style="COLOR: #000000">*></span> <span style="COLOR: #000000">聽(tīng):聽(tīng)</span> <span style="COLOR: #0000ff">public</span> <span style="COLOR: #000000">聽(tīng)Vector</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000">*></span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_318_320_Open_Image" onclick="this.style.display='none'; Codehighlighter1_318_320_Open_Text.style.display='none'; Codehighlighter1_318_320_Closed_Image.style.display='inline'; Codehighlighter1_318_320_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_318_320_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_318_320_Closed_Text.style.display='none'; Codehighlighter1_318_320_Open_Image.style.display='inline'; Codehighlighter1_318_320_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span id="Codehighlighter1_318_320_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_318_320_Open_Text"> <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> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽(tīng)_tmain(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">聽(tīng)argc,聽(tīng)_TCHAR</span> <span style="COLOR: #000000">*</span> <span style="COLOR: #000000">聽(tīng)argv[])<br /><img id="Codehighlighter1_361_461_Open_Image" onclick="this.style.display='none'; Codehighlighter1_361_461_Open_Text.style.display='none'; Codehighlighter1_361_461_Closed_Image.style.display='inline'; Codehighlighter1_361_461_Closed_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_361_461_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_361_461_Closed_Text.style.display='none'; Codehighlighter1_361_461_Open_Image.style.display='inline'; Codehighlighter1_361_461_Open_Text.style.display='inline';" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_361_461_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_361_461_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)Vector</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000">*></span> <span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)pIntVec;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pIntVec.Say();<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)Vector</span> <span style="COLOR: #000000"><</span> <span style="COLOR: #0000ff">double</span> <span style="COLOR: #000000">*></span> <span style="COLOR: #000000">聽(tīng)聽(tīng)聽(tīng)聽(tīng)pDoubleVec;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/InBlock.gif" align="top" />聽(tīng)聽(tīng)聽(tīng)聽(tīng)pDoubleVec.Say();<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">return</span> <span style="COLOR: #000000">聽(tīng)</span> <span style="COLOR: #000000">0</span> <span style="COLOR: #000000">;<br /><img src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> </div> <p> <br />杈撳嚭:<br />Vector<void*>::Hello<br />Vector<void*>::Hello<br />浠庤繖閲?鎴戜滑鍙互鐪嬪嚭紼嬪簭鍦ㄨ繍琛岃繃紼嬩腑鍏ㄩ儴浣跨敤Vector<void*>鐨勭増鏈?class Vector<T*>妯℃澘渚挎槸鍏抽敭鐨勭幆鑺?緙栬瘧鍣ㄥ湪緙栬瘧榪囩▼涓?鐢變簬class Vector<T*>姣攃lass Vector鏇寸壒渚嬪寲,鎵浠ラ亣鍒癡ector<int*>鍜孷ector<double*>鏃墮兘閫夋嫨class Vector<T*>,鑰宑lass Vector<T*>緇ф壙Vector<void*>,涓涓洿鍔犵壒渚嬪寲鐗堟湰,鎵浠ョ紪璇戝櫒涓嶅啀浜х敓鏂扮殑妯℃澘鑰岄噰鐢╒ector<void*>榪欎釜鏈鐗逛緥鍖栫増鏈?榪欐牱鎵鏈夋寚閽堟ā鏉塊兘褰掔粨鍒癡ector<void*>,鑰宑lass Vector<T*>涓虹敤鎴鋒彁渚涗簡(jiǎn)涓涓簿緹庤屼笖瀹夊叏鐨勭晫闈?鑰孷ector<void*>浣滀負(fù)搴曞眰瀹炵幇緇嗚妭琚殣钘?</p> <p>浠ヤ笂浠g爜鍦╒C 7.1(VS2003)涓紪璇戦氳繃,鐢變簬VC6瀵規(guī)ā鏉挎敮鎸佷笉濂?鎵浠ユā鏉跨殑楂樼駭鐢ㄦ硶涓鑸笉瑕佸湪VC6涓嬌鐢? <br /><a href="/files/wlwlxj/template.rar">涓嬭澆婕旂ず浠g爜</a></p> <img src ="http://www.shnenglu.com/wlwlxj/aggbug/4659.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/wlwlxj/" target="_blank">涓囪繛鏂?/a> 2006-03-27 18:54 <a href="http://www.shnenglu.com/wlwlxj/archive/2006/03/27/4659.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.22du.net.cn" target="_blank">77777亚洲午夜久久多人</a>| <a href="http://www.sushaye.cn" target="_blank">久久国产免费直播</a>| <a href="http://www.yhlj.net.cn" target="_blank">欧洲性大片xxxxx久久久</a>| <a href="http://www.nyvgcd.cn" target="_blank">国产色综合久久无码有码</a>| <a href="http://www.zhjcys.cn" target="_blank">久久r热这里有精品视频</a>| <a href="http://www.byzj.net.cn" target="_blank">久久精品无码一区二区三区日韩</a>| <a href="http://www.xyjsj88.com.cn" target="_blank">伊人久久无码中文字幕</a>| <a href="http://www.jjcxxx.cn" target="_blank">国产精品久久久久一区二区三区</a>| <a href="http://www.gnjb.net.cn" target="_blank">精品人妻伦九区久久AAA片69</a>| <a href="http://www.zjjhart.cn" target="_blank">欧美激情精品久久久久</a>| <a href="http://www.ylcq185.cn" target="_blank">久久精品国产WWW456C0M</a>| <a href="http://www.wendalaw.com.cn" target="_blank">久久久精品人妻一区二区三区四</a>| <a href="http://www.cn-yb.cn" target="_blank">色综合合久久天天给综看</a>| <a href="http://www.abovefq.cn" target="_blank">久久久精品一区二区三区</a>| <a href="http://www.wjjj8.cn" target="_blank">亚洲精品乱码久久久久久久久久久久 </a>| <a href="http://www.arm7.cn" target="_blank">亚洲国产成人久久精品影视</a>| <a href="http://www.123pojie.cn" target="_blank">国产成年无码久久久免费</a>| <a href="http://www.shjinhuashiye.cn" target="_blank">久久精品国产精品亚洲</a>| <a href="http://www.globenewswire.com.cn" target="_blank">少妇高潮惨叫久久久久久</a>| <a href="http://www.168lala.cn" target="_blank">一级做a爰片久久毛片免费陪</a>| <a href="http://www.fd-tex.cn" target="_blank">91精品国产91久久久久久青草</a>| <a href="http://www.masterflexpump.com.cn" target="_blank">久久久久久久久久久久久久</a>| <a href="http://www.q126.cn" target="_blank">色天使久久综合网天天</a>| <a href="http://www.fign.cn" target="_blank">国产亚洲色婷婷久久99精品91</a>| <a href="http://www.wucaitianyuan.cn" target="_blank">99国产欧美精品久久久蜜芽</a>| <a href="http://www.haibin860313.com.cn" target="_blank">久久久噜噜噜久久中文字幕色伊伊 </a>| <a href="http://www.qvvj.cn" target="_blank">久久综合噜噜激激的五月天</a>| <a href="http://www.buksk.cn" target="_blank">亚洲国产小视频精品久久久三级</a>| <a href="http://www.wxbdd.cn" target="_blank">久久久久综合中文字幕</a>| <a href="http://www.ems1.cn" target="_blank">99久久精品免费</a>| <a href="http://www.rpsrbk.cn" target="_blank">久久91精品综合国产首页</a>| <a href="http://www.njvwt.cn" target="_blank">精品久久久久久久中文字幕 </a>| <a href="http://www.jfhtgj.cn" target="_blank">色综合久久中文综合网</a>| <a href="http://www.jinziwan.com.cn" target="_blank">久久91精品国产91久久小草</a>| <a href="http://www.diycook.cn" target="_blank">久久久中文字幕</a>| <a href="http://www.mxylzc.cn" target="_blank">久久免费视频观看</a>| <a href="http://www.bvgj.cn" target="_blank">99久久无码一区人妻</a>| <a href="http://www.bb657.cn" target="_blank">久久国产精品波多野结衣AV</a>| <a href="http://www.kftfk.cn" target="_blank">久久青青草原精品国产不卡</a>| <a href="http://www.lkmheatlock.com.cn" target="_blank">久久se这里只有精品</a>| <a href="http://www.icrms.org.cn" target="_blank">区亚洲欧美一级久久精品亚洲精品成人网久久久久 </a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>