TriviallyCopyable
TriviallyCopyable objects can be copied by copying their object representations manually (std::memmove
). All data types compatible with the C language (POD types) are trivially copyable.
Formally, TriviallyCopyable is a concept that has to fulfil the following requirements:
- Every copy constructor is trivial or deleted
- Every move constructor is trivial or deleted
- Every copy assignment operator is trivial or deleted
- Every move assignment operator is trivial or deleted
- at least one copy constructor, move constructor, copy assignment operator, or move assignment operator is non-deleted
- Trivial non-deleted destructor
This implies that the class has no virtual functions or virtual base classes. Trivial in essence means that none of the specified special methods is user-defined. This includes also all base classes and non-static class types.