一个空的类到底有什么

class Empty{};

应该是只有四个的:默认构造函数,析构函数,复制构造函数,赋值运算符.

也即是会默认生成以下东西:

class Empty 
{ 
public:
 Empty(); 
Empty(const Empty&);
 ~Empty(); 
Empty& operator=(const Empty& rhs); 
}; 

Effective C++ 第二版勘误:

http://www.aristeia.com/BookErrata/ec++2e-errata.html

(! 2/10/00 ic 212 A class declaring no operator& function(s) 9/10/01)



posted on 2011-12-19 23:47  gapofsky  阅读(55)  评论(0)    收藏  举报

导航