C++ 概念: TriviallyCopyable

来自cppreference.com

[编辑] 要求

  • 琐碎的拷贝构造函数
    Original:
    Trivial copy constructor
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 琐碎的移动构造函数
    Original:
    Trivial move constructor
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 简单拷贝赋值运算符
    Original:
    Trivial copy assignment operator
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 琐碎的举动赋值运算符
    Original:
    Trivial move assignment operator
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • 平凡的析构函数
    Original:
    Trivial destructor
    The text has been machine-translated via Google Translate.
    You can help to correct and verify the translation. Click here for instructions.
  • No virtual functions or virtual base classes
  • All (non-static) members and base classes are TriviallyCopyable

[编辑] 注释

  1. Other than the other requirements, trivial constructor, assignment and destructor must be defined implicitly (not user-provided)
  2. Scalar types and arrays of TriviallyCopiable objects are TriviallyCopiable as well

[编辑] 另请参阅

checks if a type is trivially copyable
(类模板) [edit]