What is the pod type? Pod Full name plain old Data. In layman's words, a class or struct can keep its data intact after a binary copy, so it is a pod type. An ordinary definition1. There are trivial constructors2. There are trivial copy constructors3. There are trivial move constructors4. There is a trivial copy assignment operator5. There is a trivial move assignment operator6. There are trivial destructors7. Cannot contain virtual functions8. Cannot contain virtual base class [CPP] View plaincopy on code to view the snippet derivation to my Code slice # include"stdafx.h"#include<iostream>using namespacestd; classa {a () {}}; classb {B (b&){} }; classC {C (c&&){} }; classD {Doperator= (d&){} }; classe {Eoperator= (e&&){} }; classF {~F () {}}; classGVirtual voidFoo () =0; }; classh:g {}; classI {}; int_tmain (intARGC, _tchar*argv[]) {Std::cout<< Std::is_trivial<a>::value << Std::endl;//There is an extraordinary constructorStd::cout << std::is_trivial<b>::value << Std::endl;//There are extraordinary copy constructorsStd::cout << std::is_trivial<c>::value << Std::endl;//There is an extraordinary copy assignment operatorStd::cout << std::is_trivial<d>::value << Std::endl;//There is an extraordinary copy assignment operatorStd::cout << std::is_trivial<e>::value << Std::endl;//There is an extraordinary move assignment operatorStd::cout << std::is_trivial<f>::value << Std::endl;//There is an extraordinary destructorStd::cout << std::is_trivial<g>::value << Std::endl;//there are virtual functionsStd::cout << std::is_trivial//There are virtual base classesStd::cout<< Std::is_trivial<i>::value << Std::endl;//the Ordinary classSystem ("Pause"); return 0; The definition of the run result standard Layout1all non-static members have the same access rights2There can be at most one class in the inheritance tree with non-static data members3the first non-static member of a subclass cannot be a base class type4. No virtual function5. No virtual base class6all non-static members conform to the standard layout type [CPP] view plaincopy on code to view the snippet derivation to my Code slice # include"stdafx.h"#include<iostream>using namespacestd; classA {Private: intA; Public: intb; }; classB1 {Static intX1; }; classB2 {intx2; }; classb:b1, B2 {intx; }; classC1 {}; classc:c1 {C1 C; }; classDVirtual voidFoo () =0; }; classE:d {}; classF {A x;}; int_tmain (intARGC, _tchar*argv[]) {Std::cout<< Std::is_standard_layout<a>::value << Std::endl;//violation of definition 1. Members A and B have different access rightsStd::cout << std::is_standard_layout<b>::value << Std::endl;//violation of definition 2. The inheritance tree has two or more classes with non-static membersStd::cout << std::is_standard_layout<c>::value << Std::endl;//violation of definition 3. The first non-static member is a base class typeStd::cout << std::is_standard_layout<d>::value << Std::endl;//violation of definition 4. There are virtual functionsStd::cout << std::is_standard_layout<e>::value << Std::endl;//violation of definition 5. There are virtual base classesStd::cout << std::is_standard_layout<f>::value << Std::endl;//violation of definition 6. Non-static member x does not conform to the standard layout typeSystem ("Pause"); return 0; The use of the run results pod when a data type satisfies "trivial definition" and "standard Layout", we think of it as a pod data. You can use Std::is_pod to determine whether a type is a pod type. As stated at the beginning of the article, a pod type can be binary copy, take a look at the following example. [CPP] View plaincopy on code to see a snippet derived from my Code slice # include"stdafx.h"#include<iostream>#include<Windows.h>using namespacestd; classA { Public: intx; Doubley; }; int_tmain (intARGC, _tchar*argv[]) { if(std::is_pod<a>:: Value) {Std::cout<<"before"<<Std::endl; A; A.x=8; A.Y=10.5; Std::cout<< a.x <<Std::endl; Std::cout<< A.Y <<Std::endl; size_t size=sizeof(a); Char*p =New Char[size]; memcpy (P,&A, size); A*PA = (A *) p; Std::cout<<" After"<<Std::endl; Std::cout<< pa->x <<Std::endl; Std::cout<< Pa->y <<Std::endl; Delete p; } System ("Pause"); return 0; The results of the operation can be seen, after a binary copy of a pod type, the data is migrated successfully.