﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-C++爱好者</title><link>http://www.cppblog.com/HunDan/</link><description>C++技术交流</description><language>zh-cn</language><lastBuildDate>Tue, 09 Jun 2026 17:39:06 GMT</lastBuildDate><pubDate>Tue, 09 Jun 2026 17:39:06 GMT</pubDate><ttl>60</ttl><item><title>C++练习一自动匹配模版参数</title><link>http://www.cppblog.com/HunDan/archive/2012/03/09/167454.html</link><dc:creator>混蛋</dc:creator><author>混蛋</author><pubDate>Thu, 08 Mar 2012 16:02:00 GMT</pubDate><guid>http://www.cppblog.com/HunDan/archive/2012/03/09/167454.html</guid><wfw:comment>http://www.cppblog.com/HunDan/comments/167454.html</wfw:comment><comments>http://www.cppblog.com/HunDan/archive/2012/03/09/167454.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/HunDan/comments/commentRss/167454.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/HunDan/services/trackbacks/167454.html</trackback:ping><description><![CDATA[<div>
<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080">&nbsp;1</span><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif" /><span style="color: #000000">#include&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">iostream</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /></span><span style="color: #008080">&nbsp;2</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif" />#include&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">cstdio</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /></span><span style="color: #008080">&nbsp;3</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif" /></span><span style="color: #0000ff">using</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">namespace</span><span style="color: #000000">&nbsp;std;<br /></span><span style="color: #008080">&nbsp;4</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif" /></span><span style="color: #0000ff">namespace</span><span style="color: #000000">&nbsp;boost<br /></span><span style="color: #008080">&nbsp;5</span><span style="color: #000000"><img id="Codehighlighter1_75_931_Open_Image" onclick="this.style.display='none'; Codehighlighter1_75_931_Open_Text.style.display='none'; Codehighlighter1_75_931_Closed_Image.style.display='inline'; Codehighlighter1_75_931_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_75_931_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_75_931_Closed_Text.style.display='none'; Codehighlighter1_75_931_Open_Image.style.display='inline'; Codehighlighter1_75_931_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_75_931_Closed_Text"><img alt="" src="http://www.cppblog.com/Images/dot.gif" /></span><span id="Codehighlighter1_75_931_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">&nbsp;6</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;template&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #0000ff">bool</span><span style="color: #000000">&nbsp;v</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /></span><span style="color: #008080">&nbsp;7</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">class</span><span style="color: #000000">&nbsp;s_bool<br /></span><span style="color: #008080">&nbsp;8</span><span style="color: #000000"><img id="Codehighlighter1_120_254_Open_Image" onclick="this.style.display='none'; Codehighlighter1_120_254_Open_Text.style.display='none'; Codehighlighter1_120_254_Closed_Image.style.display='inline'; Codehighlighter1_120_254_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_120_254_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_120_254_Closed_Text.style.display='none'; Codehighlighter1_120_254_Open_Image.style.display='inline'; Codehighlighter1_120_254_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_120_254_Closed_Text"><img alt="" src="http://www.cppblog.com/Images/dot.gif" /></span><span id="Codehighlighter1_120_254_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">&nbsp;9</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">public</span><span style="color: #000000">:<br /></span><span style="color: #008080">10</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">explicit</span><span style="color: #000000">&nbsp;s_bool(</span><span style="color: #0000ff">bool</span><span style="color: #000000">&nbsp;isset)<br /></span><span style="color: #008080">11</span><span style="color: #000000"><img id="Codehighlighter1_178_220_Open_Image" onclick="this.style.display='none'; Codehighlighter1_178_220_Open_Text.style.display='none'; Codehighlighter1_178_220_Closed_Image.style.display='inline'; Codehighlighter1_178_220_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_178_220_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_178_220_Closed_Text.style.display='none'; Codehighlighter1_178_220_Open_Image.style.display='inline'; Codehighlighter1_178_220_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_178_220_Closed_Text"><img alt="" src="http://www.cppblog.com/Images/dot.gif" /></span><span id="Codehighlighter1_178_220_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">12</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&nbsp;</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">isset</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">endl;<br /></span><span style="color: #008080">13</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">14</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" /></span><span style="color: #008000"><br /></span><span style="color: #008080">16</span><span style="color: #008000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" /></span><span style="color: #000000">&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">;<br /></span><span style="color: #008080">17</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;typedef&nbsp;s_bool</span><span style="color: #000000">&lt;</span><span style="color: #0000ff">true</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;b_true;<br /></span><span style="color: #008080">18</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;typedef&nbsp;s_bool</span><span style="color: #000000">&lt;</span><span style="color: #0000ff">false</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;b_false;<br /></span><span style="color: #008080">19</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;template&nbsp;</span><span style="color: #000000">&lt;</span><span style="color: #000000">typename&nbsp;T1,</span><span style="color: #0000ff">bool</span><span style="color: #000000">&nbsp;T2</span><span style="color: #000000">&gt;</span><span style="color: #000000"><br /></span><span style="color: #008080">20</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">class</span><span style="color: #000000">&nbsp;NiftyContainer<br /></span><span style="color: #008080">21</span><span style="color: #000000"><img id="Codehighlighter1_389_813_Open_Image" onclick="this.style.display='none'; Codehighlighter1_389_813_Open_Text.style.display='none'; Codehighlighter1_389_813_Closed_Image.style.display='inline'; Codehighlighter1_389_813_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_389_813_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_389_813_Closed_Text.style.display='none'; Codehighlighter1_389_813_Open_Image.style.display='inline'; Codehighlighter1_389_813_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_389_813_Closed_Text"><img alt="" src="http://www.cppblog.com/Images/dot.gif" /></span><span id="Codehighlighter1_389_813_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">22</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">private</span><span style="color: #000000">:<br /></span><span style="color: #008080">23</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">void</span><span style="color: #000000">&nbsp;DoSomeTing(T1&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">pObj,b_true&nbsp;b)<br /></span><span style="color: #008080">24</span><span style="color: #000000"><img id="Codehighlighter1_455_548_Open_Image" onclick="this.style.display='none'; Codehighlighter1_455_548_Open_Text.style.display='none'; Codehighlighter1_455_548_Closed_Image.style.display='inline'; Codehighlighter1_455_548_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_455_548_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_455_548_Closed_Text.style.display='none'; Codehighlighter1_455_548_Open_Image.style.display='inline'; Codehighlighter1_455_548_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_455_548_Closed_Text"><img alt="" src="http://www.cppblog.com/Images/dot.gif" /></span><span id="Codehighlighter1_455_548_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">25</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T1&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">plObj</span><span style="color: #000000">=</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;T1(</span><span style="color: #000000">*</span><span style="color: #000000">pObj);<br /></span><span style="color: #008080">26</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&nbsp;</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">plObj</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;true&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">&lt;&lt;&amp;</span><span style="color: #000000">b</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">endl;<br /></span><span style="color: #008080">27</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">28</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">void</span><span style="color: #000000">&nbsp;DoSomeTing(T1&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">pObj,b_false&nbsp;b)<br /></span><span style="color: #008080">29</span><span style="color: #000000"><img id="Codehighlighter1_602_696_Open_Image" onclick="this.style.display='none'; Codehighlighter1_602_696_Open_Text.style.display='none'; Codehighlighter1_602_696_Closed_Image.style.display='inline'; Codehighlighter1_602_696_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_602_696_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_602_696_Closed_Text.style.display='none'; Codehighlighter1_602_696_Open_Image.style.display='inline'; Codehighlighter1_602_696_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_602_696_Closed_Text"><img alt="" src="http://www.cppblog.com/Images/dot.gif" /></span><span id="Codehighlighter1_602_696_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">30</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;T1&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">plObj</span><span style="color: #000000">=</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;T1(</span><span style="color: #000000">*</span><span style="color: #000000">pObj);<br /></span><span style="color: #008080">31</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&nbsp;</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">plObj</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">"</span><span style="color: #000000">&nbsp;false&nbsp;</span><span style="color: #000000">"</span><span style="color: #000000">&lt;&lt;&amp;</span><span style="color: #000000">b</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">endl;<br /></span><span style="color: #008080">32</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">33</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">public</span><span style="color: #000000">:<br /></span><span style="color: #008080">34</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">void</span><span style="color: #000000">&nbsp;DoSomeTing(T1&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">pObj)<br /></span><span style="color: #008080">35</span><span style="color: #000000"><img id="Codehighlighter1_752_807_Open_Image" onclick="this.style.display='none'; Codehighlighter1_752_807_Open_Text.style.display='none'; Codehighlighter1_752_807_Closed_Image.style.display='inline'; Codehighlighter1_752_807_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_752_807_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_752_807_Closed_Text.style.display='none'; Codehighlighter1_752_807_Open_Image.style.display='inline'; Codehighlighter1_752_807_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_752_807_Closed_Text"><img alt="" src="http://www.cppblog.com/Images/dot.gif" /></span><span id="Codehighlighter1_752_807_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">36</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DoSomeTing(pObj,s_bool</span><span style="color: #000000">&lt;</span><span style="color: #000000">T2</span><span style="color: #000000">&gt;</span><span style="color: #000000">(T2));<br /></span><span style="color: #008080">37</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">38</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">;<br /></span><span style="color: #008080">39</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">class</span><span style="color: #000000">&nbsp;Test<br /></span><span style="color: #008080">40</span><span style="color: #000000"><img id="Codehighlighter1_835_928_Open_Image" onclick="this.style.display='none'; Codehighlighter1_835_928_Open_Text.style.display='none'; Codehighlighter1_835_928_Closed_Image.style.display='inline'; Codehighlighter1_835_928_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_835_928_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_835_928_Closed_Text.style.display='none'; Codehighlighter1_835_928_Open_Image.style.display='inline'; Codehighlighter1_835_928_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_835_928_Closed_Text"><img alt="" src="http://www.cppblog.com/Images/dot.gif" /></span><span id="Codehighlighter1_835_928_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">41</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">public</span><span style="color: #000000">:<br /></span><span style="color: #008080">42</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Test()<br /></span><span style="color: #008080">43</span><span style="color: #000000"><img id="Codehighlighter1_872_921_Open_Image" onclick="this.style.display='none'; Codehighlighter1_872_921_Open_Text.style.display='none'; Codehighlighter1_872_921_Closed_Image.style.display='inline'; Codehighlighter1_872_921_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockStart.gif"><img style="display: none" id="Codehighlighter1_872_921_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_872_921_Closed_Text.style.display='none'; Codehighlighter1_872_921_Open_Image.style.display='inline'; Codehighlighter1_872_921_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedSubBlock.gif">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_872_921_Closed_Text"><img alt="" src="http://www.cppblog.com/Images/dot.gif" /></span><span id="Codehighlighter1_872_921_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">44</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cout&nbsp;</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">"</span><span style="color: #000000">Test::Test</span><span style="color: #000000">"</span><span style="color: #000000">&lt;&lt;</span><span style="color: #000000">endl;<br /></span><span style="color: #008080">45</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">;<br /></span><span style="color: #008080">46</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" />&nbsp;&nbsp;&nbsp;&nbsp;}</span></span><span style="color: #000000">;<br /></span><span style="color: #008080">47</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span style="color: #000000">;<br /></span><span style="color: #008080">48</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif" /></span><span style="color: #0000ff">using</span><span style="color: #000000">&nbsp;</span><span style="color: #0000ff">namespace</span><span style="color: #000000">&nbsp;boost;<br /></span><span style="color: #008080">49</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif" /></span><span style="color: #0000ff">int</span><span style="color: #000000">&nbsp;main()<br /></span><span style="color: #008080">50</span><span style="color: #000000"><img id="Codehighlighter1_968_1086_Open_Image" onclick="this.style.display='none'; Codehighlighter1_968_1086_Open_Text.style.display='none'; Codehighlighter1_968_1086_Closed_Image.style.display='inline'; Codehighlighter1_968_1086_Closed_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockStart.gif"><img style="display: none" id="Codehighlighter1_968_1086_Closed_Image" onclick="this.style.display='none'; Codehighlighter1_968_1086_Closed_Text.style.display='none'; Codehighlighter1_968_1086_Open_Image.style.display='inline'; Codehighlighter1_968_1086_Open_Text.style.display='inline';" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ContractedBlock.gif"></span><span style="border-bottom: #808080 1px solid; border-left: #808080 1px solid; background-color: #ffffff; display: none; border-top: #808080 1px solid; border-right: #808080 1px solid" id="Codehighlighter1_968_1086_Closed_Text"><img alt="" src="http://www.cppblog.com/Images/dot.gif" /></span><span id="Codehighlighter1_968_1086_Open_Text"><span style="color: #000000">{<br /></span><span style="color: #008080">51</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;NiftyContainer</span><span style="color: #000000">&lt;</span><span style="color: #000000">Test,</span><span style="color: #0000ff">false</span><span style="color: #000000">&gt;</span><span style="color: #000000">&nbsp;pNifty;<br /></span><span style="color: #008080">52</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;Test&nbsp;</span><span style="color: #000000">*</span><span style="color: #000000">T</span><span style="color: #000000">=</span><span style="color: #0000ff">new</span><span style="color: #000000">&nbsp;Test;<br /></span><span style="color: #008080">53</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;pNifty.DoSomeTing(T);<br /></span><span style="color: #008080">54</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;getchar();<br /></span><span style="color: #008080">55</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/InBlock.gif" />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff">return</span><span style="color: #000000">&nbsp;</span><span style="color: #000000">0</span><span style="color: #000000">;<br /></span><span style="color: #008080">56</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/ExpandedBlockEnd.gif" />}</span></span><span style="color: #000000"><br /></span><span style="color: #008080">57</span><span style="color: #000000"><img alt="" align="top" src="http://www.cppblog.com/images/OutliningIndicators/None.gif" /></span></div></div><img src ="http://www.cppblog.com/HunDan/aggbug/167454.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/HunDan/" target="_blank">混蛋</a> 2012-03-09 00:02 <a href="http://www.cppblog.com/HunDan/archive/2012/03/09/167454.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>