一个空的类到底有什么

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)



发布了32 篇原创文章 · 获赞 6 · 访问量 8万+

猜你喜欢

转载自blog.csdn.net/scutth/article/details/7086042