﻿<?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++博客-静水流深，向前无语-最新评论</title><link>http://www.cppblog.com/bourne/CommentsRSS.aspx</link><description /><language>zh-cn</language><pubDate>Thu, 28 Sep 2006 03:02:52 GMT</pubDate><lastBuildDate>Thu, 28 Sep 2006 03:02:52 GMT</lastBuildDate><generator>cnblogs</generator><item><title>re: 微软VC++对友元类和模板的支持真的这么差吗？</title><link>http://www.cppblog.com/bourne/archive/2008/03/11/8678.html#44126</link><dc:creator>WR</dc:creator><author>WR</author><pubDate>Mon, 10 Mar 2008 18:12:00 GMT</pubDate><guid>http://www.cppblog.com/bourne/archive/2008/03/11/8678.html#44126</guid><description><![CDATA[<br>#include &lt;iostream.h&gt;<br><br>template &lt;typename T&gt;<br>class Chain;<br><br>template&lt;class T&gt;<br>class ChainNode<br>{<br>	friend class Chain&lt;T&gt;;<br>private:<br>	T data;<br>	ChainNode&lt;T&gt; *link;<br>}; <br><br>template&lt;class T&gt; <br>class Chain{<br>public:<br>	Chain() <br>	{<br>		//	first = 0;<br>	}<br>	~Chain();<br>	<br>	bool IsEmpty() const {return first == 0;}<br>	int Length() const;<br>	bool Find(int k, T&amp; x) const;<br>	int Search(const T&amp; x) const;<br>	Chain&lt;T&gt;&amp; Delete(int k, T&amp; x);<br>	Chain&lt;T&gt;&amp; Insert(int k, const T&amp; x);<br>	void Output(ostream&amp; out = cout) const;<br>private:<br><br>	ChainNode&lt;T&gt; *first;						// 指向第一个节点的指针<br>}; <img src ="http://www.cppblog.com/bourne/aggbug/44126.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bourne/" target="_blank">WR</a> 2008-03-11 02:12 <a href="http://www.cppblog.com/bourne/archive/2008/03/11/8678.html#44126#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ZihH</title><link>http://www.cppblog.com/bourne/archive/2007/06/08/8756.html#25814</link><dc:creator>LiPe</dc:creator><author>LiPe</author><pubDate>Fri, 08 Jun 2007 03:24:00 GMT</pubDate><guid>http://www.cppblog.com/bourne/archive/2007/06/08/8756.html#25814</guid><description><![CDATA[AmOooOooOoO...<img src ="http://www.cppblog.com/bourne/aggbug/25814.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bourne/" target="_blank">LiPe</a> 2007-06-08 11:24 <a href="http://www.cppblog.com/bourne/archive/2007/06/08/8756.html#25814#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 转贴:链接错误LINK2001</title><link>http://www.cppblog.com/bourne/archive/2006/06/21/8756.html#8776</link><dc:creator>dudu</dc:creator><author>dudu</author><pubDate>Wed, 21 Jun 2006 01:51:00 GMT</pubDate><guid>http://www.cppblog.com/bourne/archive/2006/06/21/8756.html#8776</guid><description><![CDATA[不要在首页转载文章!<img src ="http://www.cppblog.com/bourne/aggbug/8776.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bourne/" target="_blank">dudu</a> 2006-06-21 09:51 <a href="http://www.cppblog.com/bourne/archive/2006/06/21/8756.html#8776#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: VC++中的连接问题，请大侠帮忙，我快崩溃了</title><link>http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8728</link><dc:creator>Bourne</dc:creator><author>Bourne</author><pubDate>Mon, 19 Jun 2006 13:44:00 GMT</pubDate><guid>http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8728</guid><description><![CDATA[我采取在main.cpp直接引入Chain.cpp的方法了<br>即<br>#include &quot;Chain.h&quot;-&gt;#include &quot;Chain.cpp&quot;<br>多谢各位的帮助阿！<img src ="http://www.cppblog.com/bourne/aggbug/8728.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bourne/" target="_blank">Bourne</a> 2006-06-19 21:44 <a href="http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8728#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: VC++中的连接问题，请大侠帮忙，我快崩溃了</title><link>http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8723</link><dc:creator>笑笑生</dc:creator><author>笑笑生</author><pubDate>Mon, 19 Jun 2006 12:01:00 GMT</pubDate><guid>http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8723</guid><description><![CDATA[#include &quot;Chain.h&quot;-&gt;#include &quot;Chain.cpp&quot;<br>using namespace std;<br><br>int main()<br>{<br> Chain&lt;int&gt; c;<br> cout&lt;&lt;c.Length();<br> return 0;<br>}<img src ="http://www.cppblog.com/bourne/aggbug/8723.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bourne/" target="_blank">笑笑生</a> 2006-06-19 20:01 <a href="http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8723#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: VC++中的连接问题，请大侠帮忙，我快崩溃了</title><link>http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8719</link><dc:creator>万连文</dc:creator><author>万连文</author><pubDate>Mon, 19 Jun 2006 10:54:00 GMT</pubDate><guid>http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8719</guid><description><![CDATA[模板的实现最好在.h里面，如果非要象你那样也可以，在.h里面包含.cpp。<img src ="http://www.cppblog.com/bourne/aggbug/8719.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bourne/" target="_blank">万连文</a> 2006-06-19 18:54 <a href="http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8719#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: VC++中的连接问题，请大侠帮忙，我快崩溃了</title><link>http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8717</link><dc:creator>CoderDream</dc:creator><author>CoderDream</author><pubDate>Mon, 19 Jun 2006 10:20:00 GMT</pubDate><guid>http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8717</guid><description><![CDATA[将Chain.h 和 Chain.cpp 合并成一个文件，然后修改主函数中的第一句：<br>Chain&lt;int&gt; c(666);//要带参数，不然没有匹配的构造函数<br><br>但是运行结果为0，显然不对，再看看哪里出了问题。<br><br>有模板时最好将函数的声明和定义写在同一个文件中<img src ="http://www.cppblog.com/bourne/aggbug/8717.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bourne/" target="_blank">CoderDream</a> 2006-06-19 18:20 <a href="http://www.cppblog.com/bourne/archive/2006/06/19/8711.html#8717#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 微软VC++对友元类和模板的支持真的这么差吗？</title><link>http://www.cppblog.com/bourne/archive/2006/06/19/8678.html#8697</link><dc:creator>Bourne</dc:creator><author>Bourne</author><pubDate>Mon, 19 Jun 2006 01:59:00 GMT</pubDate><guid>http://www.cppblog.com/bourne/archive/2006/06/19/8678.html#8697</guid><description><![CDATA[试了一下，果然是这个错误，谢谢朋友的指点啊！<img src ="http://www.cppblog.com/bourne/aggbug/8697.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bourne/" target="_blank">Bourne</a> 2006-06-19 09:59 <a href="http://www.cppblog.com/bourne/archive/2006/06/19/8678.html#8697#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 微软VC++对友元类和模板的支持真的这么差吗？</title><link>http://www.cppblog.com/bourne/archive/2006/06/18/8678.html#8692</link><dc:creator>Corner</dc:creator><author>Corner</author><pubDate>Sun, 18 Jun 2006 13:59:00 GMT</pubDate><guid>http://www.cppblog.com/bourne/archive/2006/06/18/8678.html#8692</guid><description><![CDATA[是啊！缺了template&lt;class T&gt; class Chain;的前向声明在template&lt;class T&gt; struct ChainNode前面.<img src ="http://www.cppblog.com/bourne/aggbug/8692.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bourne/" target="_blank">Corner</a> 2006-06-18 21:59 <a href="http://www.cppblog.com/bourne/archive/2006/06/18/8678.html#8692#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>re: 微软VC++对友元类和模板的支持真的这么差吗？</title><link>http://www.cppblog.com/bourne/archive/2006/06/18/8678.html#8686</link><dc:creator>mroske</dc:creator><author>mroske</author><pubDate>Sun, 18 Jun 2006 07:01:00 GMT</pubDate><guid>http://www.cppblog.com/bourne/archive/2006/06/18/8678.html#8686</guid><description><![CDATA[// 在 ChainNode 之前声明 Chain 。<br>template&lt;class T&gt;<br>class Chain;<br><br>template&lt;class T&gt;<br>struct ChainNode<br>{<br>	friend class Chain&lt;T&gt;; // class Chain&lt;T&gt; 在没有声明之前<br>                               // 不被发现。。。<br>                               // 因为 friend class Chain&lt;T&gt;<br>                                           // 不是声明 Chain 是类模板。<br>                               //  -- 以上个人之见。<br>private:<br>	T data;<br>	ChainNode&lt;T&gt; *link;<br>};<br><br><img src ="http://www.cppblog.com/bourne/aggbug/8686.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bourne/" target="_blank">mroske</a> 2006-06-18 15:01 <a href="http://www.cppblog.com/bourne/archive/2006/06/18/8678.html#8686#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>