POD

  • Thread starter Wolfgang Jeltsch
  • Start date
W

Wolfgang Jeltsch

Hello,

currently, I use a C++ Draft Standard from the end of 1996. It often speaks
about POD types but unfortunately I cannot find a definition of this term.
What does it mean?

Wolfgang
 
U

Unforgiven

Wolfgang said:
Hello,

currently, I use a C++ Draft Standard from the end of 1996. It often
speaks about POD types but unfortunately I cannot find a definition
of this term. What does it mean?

POD stands for "Plain Old Data". A POD type is either a scalar (int, double,
whatever) or a simple class or struct with only other POD types and simple
member functions. Do a google search on Plain Old Data and you'll find more
concise definitions of what is and is not a POD type.
 
S

Stephen Howe

currently, I use a C++ Draft Standard from the end of 1996. It often
speaks
about POD types but unfortunately I cannot find a definition of this term.
What does it mean?

Plain Old Data.

This struct

struct structtag
{
int x;
int y;
};

has no constructor, destructor, copy constructor, member functions. You
could, with the right C compiler, pass it to a C API.

Stephen Howe
 
R

Russell Hanneken

Wolfgang Jeltsch said:
currently, I use a C++ Draft Standard from the end of 1996. It often
speaks about POD types but unfortunately I cannot find a definition of
this term. What does it mean?

From the C++ standard:

"An aggregate is an array or a class with no user-declared constructors, no
private or protected non-static data members, no base classes, and no
virtual functions" (section 8.5.1, paragraph 1).

"A POD-struct is an aggregate class that has no non-static data members of
type pointer to member, non-POD-struct, non-POD-union (or array of such
types) or reference, and has no user-defined copy assignment operator and no
user-defined destructor. Similarly, a POD-union is an aggregate union that
has no non-static data members of type pointer to member, non-POD-struct,
non-POD-union (or array of such types) or reference, and has no user-defined
copy assignment operator and no user-defined destructor. A POD class is a
class that is either a POD-struct or a POD-union" (section 9, paragraph 4).

"Arithmetic types, enumeration types, pointer types, and pointer to member
types, and cv-qualified versions of these types are collectively called
scalar types. Scalar types, POD-struct types, POD-union types, arrays of
such types and cv-qualified versions of these types are collectively called
POD types" (section 3.9, paragraph 10).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top