美文网首页C++ 杂记
C++ 中的空类,会为我们默认生成哪些类成员函数?

C++ 中的空类,会为我们默认生成哪些类成员函数?

作者: 赵者也 | 来源:发表于2017-10-29 20:47 被阅读6次
    class Empty
    {
    public:
       Empty();                          // 缺省构造函数
       Empty( const Empty& );            // 拷贝构造函数
       ~Empty();                         // 析构函数
       Empty& operator=( const Empty& ); // 赋值运算符
       Empty* operator&();               // 取址运算符
       const Empty* operator&() const;   // 取址运算符
    };
    

    相关文章

      网友评论

        本文标题:C++ 中的空类,会为我们默认生成哪些类成员函数?

        本文链接:https://www.haomeiwen.com/subject/fxcupxtx.html