std::is_pod

Header: <type_traits>

std::is_pod is a UnaryTypeTrait.

# Declarations

template< class T >
struct is_pod;

(since C++11) (deprecated in C++20)

# Example

#include <type_traits>
 
struct A { int m; };
static_assert(std::is_pod_v<A> == true);
 
class B: public A { int m; };
static_assert(std::is_pod_v<B> == false);
 
struct C { virtual void foo(); };
static_assert(std::is_pod_v<C> == false);
 
int main() {}

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 2015C++11T could be an array of incompleteclass type with unknown boundthe behavior isundefined in this case

# See also