C + + Terminology-Class "C++primer fourth Edition"

Source: Internet
Author: User
Tags define abstract

Abstract data type (abstract datatype): Uses encapsulation to hide the data structure of its implementation, allowing programmers of the type to think abstractly about what the type does, rather than specifically considering how the type is represented. Classes in C + + can be used to define abstract data types.

Access label (Access label): Public, private, protected, which specifies that subsequent members can be accessed by the class's consumer or only by friends and members of the class. Each label sets access protection for the member that is declared between the label and the next label. The label can appear multiple times.

Class (Class): a mechanism for defining abstract data types in C + +, which can have data, functions, or type members. A class defines a new type and a new scope.

Class declaration: A class can be declared before it is defined. A class declaration is represented by a keyword class (or struct) followed by a class name and a semicolon. A class that has been declared but not defined is an incomplete type.

Class keyword (class keyword): In classes defined by the class keyword, the initial implicit access designator is private.

Class scope: Each class defines a scope. The scope of a class is much more complex than other scopes-member functions defined within the definition of a class can use names that appear after the definition.

Concrete Class (Specific Class): Classes that expose their implementation details.

Const member function (constant member functions): A member function that cannot alter the ordinary (that is, neither static nor mutable) data members of the object. The this pointer in the const member points to the Const object. Whether a member function can be overloaded depends on whether the function is const.

constructor initializer list (constructor initialization lists): Specifies the initial value of the data member of the class. Initializes the member with the value specified in the initialization list before the constructor body executes. Class members that are not initialized in the initialization list are implicitly initialized with their default constructors.

Conversion Constructor (conversion constructor): A non-explicit constructor that can be called with a single argument. The conversion constructor is used implicitly to convert the type of an argument to a class type.

Data Abstraction: Programming techniques that focus on type interfaces. Data abstraction allows programmers to ignore the details of how a type is represented, and only consider the actions that the type can perform. Data abstraction is the foundation of object-oriented programming and generic programming.

default constructor: The constructor used when initialization is not specified.

Encapsulation (encapsulation): Implements the separation from the interface. Encapsulation hides the implementation details of the type. In C + +, encapsulation can prevent ordinary users from accessing the private part of a class.

Explicit Constructor (display constructor): a constructor that can be invoked with a single argument but cannot be used to perform an implicit conversion. It is set to explicit by placing the keyword explicit before the declaration of the constructor.

Forward Declaration (Forward declaration): a declaration of a name that has not been defined. Most are used to refer to class declarations that appear before the class definition. See also non-complete types.

Friend (Friend): The mechanism by which a class authorizes access to its non-public members. Both classes and functions can be assigned a friend. Friends have the same access rights as members.

Incomplete type (not fully typed): declared but undefined. You cannot use an incomplete type to define a variable or class member. It is legal to define a reference or pointer to an incomplete type.

member functions (member functions): A function member of a class. The normal member function is bound to the class type object by an implicit this pointer. The static member function is not bound to the object and does not have the this pointer. member functions can be overloaded, as long as the version of the function can be distinguished by the number or type of formal parameters.

mutable data member (variable data member): A member of a database that can never be a const object, even if it is a member of a const object, it cannot be a const object. Mutable members can be changed in the const function.

Name Lookup: The process of matching the name with its corresponding declaration.

Private member: a member defined after the private access designator, accessible only by friends and other class members. The data members and utility functions used by the class are usually declared private when they are not part of the type interface.

Public member (Total members): a member defined after the public access designator can be accessed by any user of the class. Generally, only functions that define class interfaces should be defined in the public section.

Static member: A data or function member that is not part of an arbitrary object, but is shared by the entire object of a given class.

C + + Terminology-Class "C++primer fourth Edition"

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.