![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
zwd2005
Study/Program/Games
展开
-
mark: 重载模板类输出操作符
C++ primer4 Ch16首先了解Specific Template Friendship、General Template Friendship及常用方式的区别。重载输出操作在g++和vs2008环境下需要使用一般友元关系:templatetypename Type>class Queue { templatetypename U> friend ostream& operat原创 2008-12-01 16:03:00 · 421 阅读 · 0 评论 -
Note:Behavior of polymorphic methods inside constructors
thinking in java中的一个例子,java和C++表现不是特别一致:#include using namespace std;class Base {public: Base() { cout << "Before draw" << endl; Draw(); cout << "After draw" << endl; } virtual原创 2009-02-25 19:36:00 · 395 阅读 · 0 评论 -
[TEST]无默认构造函数类的初始化及容器操作
#include #include using namespace std;class NoDefault { friend ostream& operator << (ostream& os, const NoDefault& o);private: static unsigned _id; unsigned id; unsigned pid;public:原创 2009-03-03 09:54:00 · 575 阅读 · 0 评论