Plain Old Data

What are Plain Old Data (POD) Objects?

A POD (plain old data) object has one of these data types--a fundamental type, pointer, union, struct, array, or class--with no constructor. Conversely, a non-POD object is one for which a constructor exists. A POD object begins its lifetime when it obtains storage with the proper size for its type and its lifetime ends when the storage for the object is either reused or deallocated.

PlainOldData is actually a term used in the ANSI/ISO C++ standard. Who says standards committees have no sense of humor?

PlainOldData types also must not have any of:

A looser definition of PlainOldData includes objects with constructors; but excludes those with virtual anything. The important issue with PlainOldData types is that they are non-polymorphic. Inheritance can be done with POD types, however it should only be done for ImplementationInheritance (code reuse) and not polymorphism/subtyping.

A common (though not strictly correct) definition is that a PlainOldData type is anything that doesn't have a VeeTable.

Contributors: DannyKalev?, ScottJohnson

View edit of November 10, 2014 or FindPage with title or text search