C + + pod type

Source: Internet
Author: User
Tags scalar

POD (Plain old Data) concept:
arithmetic Types (3.9.1), enumeration types, pointer types, and pointer to member types (3.9.2), and cv-qualified (Note 2 ) 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) is collectively called POD types.
If a class has no non-trivial constructor, destructor, and copy assignmet operator These things, the class has actually degenerated into a pod type, is equivalent to a struct in C. pod types include the following types: 1. Scalar type, basic type of C + +
    • Signed integer types (signed char, short, int, long),
    • unsigned integer types (unsigned char,unsigned short, unsigned int,unsigned long),
    • Char and wchar_t, and
    • bool.
    • float, double, and long double
    • Pointer-to-void (void *),
    • Pointer-to-object and Pointer-to-static-member-data (both of the form t* when pointing to an object of Typet), and
    • Pointer-to-function and Pointer-to-static-member-function (both of the form T (*) (...) When pointing to a function that re Turns an object of Typet).
    • Pointer-to-nonstatic-member-data (of the form T C::* when pointing to one of ClassC's data members which has type T), and
    • Pointer-to-nonstatic-member-functions (of the form T (C::*) (...) when pointing to one of ClassC's member functions that re Turns an object of Typet).
2. User-defined class type:
    • Non-static data (including arrays) of any pointer-to-member type,
    • Non-static data (including arrays) of any non-pod class type,
    • Non-static data of any reference type,
    • user-defined copy assignment operator, nor
    • User-defined destructor.
    • User-declared Constructors,
    • Private or protected non-static data members,
    • base classes, nor
    • Virtual functions.

C + + pod type

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.