C++类创建时的困惑

来源:互联网 发布:jquery 2.1.0.min.js 编辑:程序博客网 时间:2024/05/17 01:28

一个C++的空类默认将产生的成员函数有:

1--缺省的构造函数

2--拷贝构造函数

3--析构函数

4--赋值运算符

5--取址运算符

6--取址运算符const

#ifndef _Empty
#define _Empty
class Empty
{
public:
    Empty();
    Empty const(Empty&);
    ~Empty();
    Empty& operator=(const Empty&);
    Empty* operator&();
    const Empty* operator&() const;
};

#endif

原创粉丝点击