摘要: 为什么C++编译器不能支持对模板的分离式编译,现在下面是 刘未鹏(pongba) 的文章,从网上抄录下来,不知道出处。但是我已经对它进行了整理。====C++ 编译器的工作简介=========================在 C++ 标准中提到,一个编译单元 [ Translation Unit ] 是指一个.cpp文件以及它所include的所有.h文件。.h文件里的代码将会被扩展到包含它的.cpp文件里,然后编译器编译该.cpp 文件为一个.obj文件,后者拥有PE [ Portable Executable,即 Windows 可执行文件 ] 文件格式,并且本身包含的就已经是二进制码 阅读全文
posted @ 2011-11-12 21:28 YipWingTim 阅读(165) 评论(0) 推荐(0) 编辑
摘要: View Code 1 #include<iostream> 2 #include<cstring> 3 using namespace std; 4 5 template<class Type> class List 6 { 7 private: 8 template<class T> class LinkNode 9 { 10 public: 11 LinkNode<Type>* link; 12 Type data; 13 14 LinkNode(LinkNode<Type>* ptr=NUL... 阅读全文
posted @ 2011-11-12 00:36 YipWingTim 阅读(256) 评论(0) 推荐(0) 编辑