Topic: POD?


Author: brahms@mindspring.com (Stan Brown)
Date: 1999/11/11
Raw View
[This followup was also e-mailed to the cited author for speed -- please
follow up in the newsgroup.]

beszedes@cc.u-szeged.hu (Beszedes Arpad) wrote in comp.std.c++:

>At several places in the standard the acronym(?) POD is used (e.g.
>section 3.9), but I cannot find its definition (not even in the Index).
>Could someone explain its meaning?

I asked this question a couple of months ago, and then a week later
somebody else asked it. I saved the most helpful responses in a text
file.

Rather than post it here, I've put it on the Web and anyone interested
can read it there:

 http://www.mindspring.com/~brahms/pod.txt

--
Stan Brown, Oak Road Systems, Cleveland, Ohio, USA
                http://www.mindspring.com/~brahms/
C++ FAQ Lite: http://www.cerfnet.com/~mpcline/c++-faq-lite/
the C++ standard: http://webstore.ansi.org/ansidocstore/default.asp
more FAQs: http://www.mindspring.com/~brahms/faqget.htm
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: Beszedes Arpad <beszedes@cc.u-szeged.hu>
Date: 1999/11/11
Raw View
Hi,
At several places in the standard the acronym(?) POD is used (e.g.
section 3.9), but I cannot find its definition (not even in the Index).
Could someone explain its meaning?
Thanks,
  Arpad.

--
***********************************************
*  Arpad Beszedes (research engineer)         *
*                                             *
*  Research Group on Artificial Intelligence  *
*  Hungarian Academy of Sciences              *
*  Attila Jozsef University, Szeged, Hungary  *
*  e-mail: beszedes@cc.u-szeged.hu            *
*  tel.: (+36) 62/45-41-45                    *
***********************************************
* "To err is human, but to really mess things *
*          up you need a computer."           *
***********************************************
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: Darin Adler <darin@bentspoon.com>
Date: 1999/11/11
Raw View
Beszedes Arpad <beszedes@cc.u-szeged.hu> wrote:

> At several places in the standard the acronym(?) POD is used (e.g.
> section 3.9), but I cannot find its definition (not even in the Index).
> Could someone explain its meaning?

The first mention of POD in the standard, in section 1.8, has the footnote:
'The acronym POD stands for "plain old data."'

For a thorough definition, you really have to read all the mentions of POD
in the standard, but roughly speaking, POD is used for C-like data types to
allow certain C coding idioms to apply. This give the freedom for other data
types that aren't found in C to be implemented in ways that would prevent
these idioms from working.

So the POD rules mean that you can use memcpy to copy a struct that could
have been defined in C, but it's not guaranteed to work for a class with
virtual functions, for example.

    -- Darin
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: Ron Natalie <ron@sensor.com>
Date: 1999/11/11
Raw View
The expansion of the acronym is a footnote to the first occurance
(means Plain Old Data).  The termin is nomintaviely defined in
3.9 paragraph 10:

  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 called 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.
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]





Author: wmm@fastdial.net
Date: 1999/11/11
Raw View
In article <3829D8A6.3E696DE@sun.com>,
  Steve Clamage <stephen.clamage@sun.com> wrote:
>
> Beszedes Arpad wrote:
> >
> > At several places in the standard the acronym(?) POD is used (e.g.
> > section 3.9), but I cannot find its definition (not even in the
Index).
> > Could someone explain its meaning?
>
> POD ("Plain Old Data") is defined in Clause 9, paragraph 4 of
> the C++ standard. It is defined in terms of an "aggregate",
> which is defined in 8.5.1.
>
> The exact definition is a bit long to reproduce here. The idea is
> that a POD struct or (POD union) is one that can be declared in a
> C program. PODs have the same properties in C++ that they do in C.
> But classes can have some C++ features, like static members
> and typedefs, and still be PODs.

Actually, POD applies to more than just classes and unions, which
is what is defined in 9p4.

The acronym is explained at its first use, in a footnote to 1.8p5.
The definition of the term is in 3.9p10.  That definition references
the material Steve mentioned in clause 9, but it also includes all
scalar types.
--
William M. Miller, wmm@fastdial.net
OnDisplay, Inc. (www.ondisplay.com)


Sent via Deja.com http://www.deja.com/
Before you buy.


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: Beszedes Arpad <beszedes@cc.u-szeged.hu>
Date: 1999/11/10
Raw View
Hi,
At several places in the standard the acronym(?) POD is used (e.g.
section 3.9), but I cannot find its definition (not even in the Index).
Could someone explain its meaning?
Thanks,
  Arpad.

--
***********************************************
*  Arpad Beszedes (research engineer)         *
*                                             *
*  Research Group on Artificial Intelligence  *
*  Hungarian Academy of Sciences              *
*  Attila Jozsef University, Szeged, Hungary  *
*  e-mail: beszedes@cc.u-szeged.hu            *
*  tel.: (+36) 62/45-41-45                    *
***********************************************
* "To err is human, but to really mess things *
*          up you need a computer."           *
***********************************************


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]






Author: Steve Clamage <stephen.clamage@sun.com>
Date: 1999/11/10
Raw View
Beszedes Arpad wrote:
>
> At several places in the standard the acronym(?) POD is used (e.g.
> section 3.9), but I cannot find its definition (not even in the Index).
> Could someone explain its meaning?

POD ("Plain Old Data") is defined in Clause 9, paragraph 4 of
the C++ standard. It is defined in terms of an "aggregate",
which is defined in 8.5.1.

The exact definition is a bit long to reproduce here. The idea is
that a POD struct or (POD union) is one that can be declared in a
C program. PODs have the same properties in C++ that they do in C.
But classes can have some C++ features, like static members
and typedefs, and still be PODs.

--
Steve Clamage, stephen.clamage@sun.com


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]