C++学习笔记(7)

C++ Primer Chapter 9

Sequential Container

  • 一般使用vector

C++ Primer Chapter 13

Copy Control 拷贝控制

通过以下成员function进行控制

  • copy constructor
  • copy-assignment operator
  • move constructor
  • move-assignment operator
  • destructor

Rule of three

但凡自定义了其中一个剩下的都要进行定义:

  • copy constructor
  • copy-assignment operator
  • destructor

Rule of five

但凡自定义了其中一个剩下的都要进行定义:

  • copy constructor
  • copy-assignment operator
  • move constructor
  • move-assignment operator
  • destructor