Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <h3>Very informally:</h3> <p>A POD is a type (including classes) where the C++ compiler guarantees that there will be no "magic" going on in the structure: for example hidden pointers to vtables, offsets that get applied to the address when it is cast to other types (at least if the target's POD too), constructors, or destructors. Roughly speaking, a type is a POD when the only things in it are built-in types and combinations of them. The result is something that "acts like" a C type.</p> <h3>Less informally:</h3> <ul> <li><code>int</code>, <code>char</code>, <code>wchar_t</code>, <code>bool</code>, <code>float</code>, <code>double</code> are PODs, as are <code>long/short</code> and <code>signed/unsigned</code> versions of them.</li> <li>pointers (including pointer-to-function and pointer-to-member) are PODs, </li> <li><code>enums</code> are PODs</li> <li>a <code>const</code> or <code>volatile</code> POD is a POD.</li> <li>a <code>class</code>, <code>struct</code> or <code>union</code> of PODs is a POD provided that all non-static data members are <code>public</code>, and it has no base class and no constructors, destructors, or virtual methods. Static members don't stop something being a POD under this rule.</li> <li>Wikipedia is wrong to say that a POD cannot have members of type pointer-to-member. Or rather, it's correct for the C++98 wording, but TC1 made explicit that pointers-to-member are POD.</li> </ul> <h3>Formally (C++03 Standard):</h3> <blockquote> <p><strong>3.9(10):</strong> "Arithmetic types (3.9.1), enumeration types, pointer types, and pointer to member types (3.9.2) and cv-qualified versions of these types (3.9.3) are collectively caller scalar types. Scalar types, POD-struct types, POD-union types (clause 9), arrays of such types and cv-qualified versions of these types (3.9.3) are collectively called POD types"</p> <p><strong>9(4):</strong> "A POD-struct is an aggregate class that has no non-static data members of type non-POD-struct, non-POD-union (or array of such types) or reference, and has no user-define copy operator and no user-defined destructor. Similarly a POD-union is an aggregate union that has no non-static data members of type non-POD-struct, non-POD-union (or array of such types) or reference, and has no user-define copy operator and no user-defined destructor.</p> <p><strong>8.5.1(1):</strong> "An aggregate is an array or class (clause 9) with no user-declared constructors (12.1), no private or protected non-static data members (clause 11), no base classes (clause 10) and no virtual functions (10.3)."</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload