effective C ++ 条款五 了解C++默默编写并调用哪些函数

class Empty{};

class Empty {

  public :

  Empty() {...}

  Empty(const Empty &rhs) {...}

  Empty& operator = (const Empty &rhs){...}

  ~Empty() {...}

};

编译器可以为class 创建default 构造函数,copy构造函数, copy assignment 构造函数, 以及析构函数。

 

posted on 2020-09-23 01:26  123_123  阅读(116)  评论(0编辑  收藏  举报