POD

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wolfgang Jeltsch

    POD

    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
  • Unforgiven

    #2
    Re: POD

    Wolfgang Jeltsch wrote:[color=blue]
    > 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?[/color]

    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.

    --
    Unforgiven

    "Most people make generalisations "
    Freek de Jonge

    Comment

    • Stephen Howe

      #3
      Re: POD

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

      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


      Comment

      • Alexander Terekhov

        #4
        Re: POD


        Wolfgang Jeltsch wrote:
        [...][color=blue]
        > What does it mean?[/color]

        Same thing as POF, but for data.

        regards,
        alexander.

        Comment

        • Alexander Terekhov

          #5
          Re: POD


          Unforgiven wrote:

          [snip blah-blah-blah]


          (What's this "POD" thing in C++ I keep hearing about?)

          regards,
          alexander.

          Comment

          • Alexander Terekhov

            #6
            Re: POD


            Stephen Howe wrote:
            [...][color=blue]
            > has no constructor, destructor, copy constructor, member functions. You
            > could, with the right C compiler, pass it to a C API.[/color]

            FYI, <http://std.dkuug.dk/jtc1/sc22/wg21/docs/papers/2002/n1356.html>.

            regards,
            alexander.

            Comment

            • Russell Hanneken

              #7
              Re: POD

              "Wolfgang Jeltsch" <jeltsch@tu-cottbus.de> wrote in message
              news:bj5qhl$fhv f3$1@ID-77306.news.uni-berlin.de...[color=blue]
              >
              > 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?[/color]

              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).

              --
              Russell Hanneken
              rhanneken@pobox .com


              Comment

              • llewelly

                #8
                Re: POD

                Wolfgang Jeltsch <jeltsch@tu-cottbus.de> writes:
                [color=blue]
                > 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?[/color]

                See this thread in a related group:


                (my post)

                Comment

                • Shane Beasley

                  #9
                  Re: POD

                  Wolfgang Jeltsch <jeltsch@tu-cottbus.de> wrote in message news:<bj5qhl$fh vf3$1@ID-77306.news.uni-berlin.de>...
                  [color=blue]
                  > 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?[/color]

                  The URL

                  <http://www.everything2 .com/index.pl?node_i d=1245318>

                  has a decent description of what it means, both literally (its
                  definition) and practically (what you can do with it).

                  - Shane

                  Comment

                  Working...