摘要:
用struct做map的key会需要"operator #include #include using namespace std;//////////////////////////////////////////////////////////////////////////struct s{ int x; int y;};void main(){ map m; s* a = new s; a->x = 1; a->y = 2; s* b = new s; b->x = 1; b->y = 2; m.insert(pair(a, ... 阅读全文
摘要:
#include #include using namespace std;templateclass S{public: S() {} static T* t; static void gen() { static T p; t = &p;/* t = new T();*/ }};class A : public S { public: char carr[1024]; };A* A::t = NULL;class B : public S { public: char carr[2048]; };B* B::t = N... 阅读全文