Topic: What are POD types?


Author: "Victor Bazarov" <vAbazarov@dAnai.com>
Date: 2000/08/03
Raw View
"Joe Drumm" <jdrumm@online.no> wrote...
> What exactly is meant by a "POD" type?  Does this refer to primitive
types
> in the language like int, long, char, etc?

And also arrays of them, unions, and structs with no member functions,
IIRC.

Victor
--
Please remove capital A's from my address when replying by mail



---
[ 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: comeau@panix.com (Greg Comeau)
Date: 2000/08/03
Raw View
In article <4AobM5AuvTi5EwaO@robinton.demon.co.uk>,
Francis Glassborow  <francisG@robinton.demon.co.uk> wrote:
>In article <Rb_h5.26957$MS3.451510@news1.online.no>, Joe Drumm
><jdrumm@online.no> writes
>>What exactly is meant by a "POD" type?  Does this refer to primitive types
>>in the language like int, long, char, etc?

Yes, although it usually deals with structs.

>No, it refers to UDTs that necessarily have the same semantics as those
>in C (that is slightly over simplified).

A POD refers to more than just UDT's.

For more details, check out

     http://www.comeaucomputing.com/techtalk/#pod

- Greg
--
Comeau Computing / Comeau C/C++ 4.2.42 (4.2.44 expected soon)
TRY Comeau C++ ONLINE at http://www.comeaucomputing.com/tryitout
Email: comeau@comeaucomputing.com / WEB: http://www.comeaucomputing.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              ]






Author: David R Tribble <david@tribble.com>
Date: 2000/08/04
Raw View
James Kuyper wrote:
> ...
> I just noticed something interesting. Neither a POD-struct nor a
> POD-union may contain a pointer to member. However, a pointer to
> member, or an array of them, is itself a POD type, and that's not
> something with any direct C analog.

I believe that's an issue currently being addressed by the committee,
with plans to remove that restriction.
[http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_active.html#148]

--
David R. Tribble, mailto:david@tribble.com, http://david.tribble.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              ]






Author: "Lars Hammer" <lch@elsamprojekt.dk>
Date: 2000/08/04
Raw View
Joe Drumm <jdrumm@online.no> wrote in message
news:Rb_h5.26957$MS3.451510@news1.online.no...
> What exactly is meant by a "POD" type?  Does this refer to primitive types
> in the language like int, long, char, etc?

POD is Plain Old Data, referring to the old C data structures.
POD's are the primitives: int, char, float etc., C structs and unions and
arrays of these types.

Yours
Lars Hammer


---
[ 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: Barry Margolin <barmar@genuity.net>
Date: 2000/08/02
Raw View
In article <Rb_h5.26957$MS3.451510@news1.online.no>,
Joe Drumm <jdrumm@online.no> wrote:
>What exactly is meant by a "POD" type?  Does this refer to primitive types
>in the language like int, long, char, etc?

No, it refers to structures that don't make use of any C++'s OO features,
which generally can be implemented the same as they would in C.

--
Barry Margolin, barmar@genuity.net
Genuity, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

---
[ 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: "Joe Drumm" <jdrumm@online.no>
Date: 2000/08/03
Raw View
What exactly is meant by a "POD" type?  Does this refer to primitive types
in the language like int, long, char, etc?

Thanks

Joe



---
[ 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: Francis Glassborow <francis@robinton.demon.co.uk>
Date: 2000/08/03
Raw View
In article <Rb_h5.26957$MS3.451510@news1.online.no>, Joe Drumm
<jdrumm@online.no> writes
>What exactly is meant by a "POD" type?  Does this refer to primitive types
>in the language like int, long, char, etc?

No, it refers to UDTs that necessarily have the same semantics as those
in C (that is slightly over simplified).

Francis Glassborow      Association of C & C++ Users
64 Southfield Rd
Oxford OX4 1PA          +44(0)1865 246490
All opinions are mine and do not represent those of any organisation

---
[ 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: James Kuyper <kuyper@wizard.net>
Date: 2000/08/03
Raw View
Francis Glassborow wrote:
>
> In article <Rb_h5.26957$MS3.451510@news1.online.no>, Joe Drumm
> <jdrumm@online.no> writes
> >What exactly is meant by a "POD" type?  Does this refer to primitive types
> >in the language like int, long, char, etc?
>
> No, it refers to UDTs that necessarily have the same semantics as those
> in C (that is slightly over simplified).

The term doesn't just refer to UDTs, it also include the arithmetic
types, which includes the ones Joe Drumm called primitive types:

3.9p10: "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_."

I just noticed something interesting. Neither a POD-struct nor a
POD-union may contain a pointer to member. However, a pointer to member,
or an array of them, is itself a POD type, and that's not something with
any direct C analog.

---
[ 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              ]