Definition of Class _ class

Source: Internet
Author: User

1. Explicitly specify an inline member function

You can specify that a member is inline as its declaration within the class definition body. Inline can also be specified on a function definition outside the body of the class definition. It is legal to specify inline at the declaration and definition.

The definition of an inline member function must be visible in every source file that invokes the function. An inline member function that is not defined in the class definition body, whose definition should normally be placed in the same header file as the class definition.

2. A data member can be specified as a class type only if the class definition has already been previously present. If the type is not a full type, the data member can only be a pointer to that type or reference. (A class is called an incomplete type before it is defined after the declaration.) )

Because a class cannot be defined until the class definition body is complete, the class cannot have data members of its own type. However, as long as the class name is present, it can be assumed that the class is declared, so that the data members of the class can make a pointer or reference only to the type of itself. For example:

Class Linkscreen {screen    window;    Linkscreen *next;    Linkscreen *prev;};

Definition of Class _ class

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.