What are POD types in C++?
c++, c++-faq, types
Solution
POD stands for Plain Old Data - that is, a class (whether defined with the keyword `struct` or the keyword `class`) without constructors, destructors and virtual members functions. Wikipedia's article on POD goes into a bit more detail and defines it as:
A Plain Old Data Structure in C++ is an aggregate class that contains only PODS as members, has no user-defined destructor, no user-defined copy assignment operator, and no nonstatic members of pointer-to-member type.
Greater detail can be found in this answer for C++98/03. C++11 changed the rules surrounding POD, relaxing them greatly, thus necessitating a follow-up answer here.
Problem
I've come across this term POD-type a few times. What does it mean?
Related problems
- Why is std::is_pod deprecated in C++20?
- Is std::array<T, S> guaranteed to be POD if T is POD?
- PODs, non-PODs, rvalue and lvalues
- What are aggregates and trivial types/PODs, and how/why are they special?
- Can a class with all private members be a POD class?
- ignoring packed attribute because of unpacked non-POD field
- What are aggregates and trivial types/PODs, and how/why are they special?