rule.

Yoon Sunkue·2021년 9월 27일
1

표준

목록 보기
1/2

c++11 class default operator

  • Default Constructor :: Exist on No Constructors.
  • Copy Constructors :: Exist on No Move operators.
  • Copy Assignment :: Exist on No Move operators.
  • Move Constructors :: Exist on No Copy/Move operators & Destructors.
  • Move Assignment :: Exist on No Copy/Move operators & Destructors.
  • Destructors :: Basically noexcept. Virtual if parents have virtual Destructors.

# if there is a template member funtion, like template<class T> CLASS(const T&); still default operators are exist. like CLASS(const CLASS&);.

  • move should be noexcept. In class parents and member sould have move too

values

  • lvalue :: identity (이름) 을 가지고 있으며, move 될 수 없음.
  • xvalue :: identity (이름) 을 가지고 있으며, move 될 수 있음.
  • prvalue :: identity (이름) 이 없고, move 될 수 있음.
  • rvalue :: prvalue | xvalue moveable
  • glvalue :: lvalue | xvalue has_identity

비표준

  • Rule of 3 :: Copy Constructors & Copy Assignment & Destructors are set. Because one of these means resource management.

0개의 댓글