标签:
Member functions
Functions declared in the definition of a class, excluding those declared with a friend specifier (11.3), are called member functions of that class.
定义在类中的已声明的函数,除去声明中带有friend的说明符的那些,都被称为那个类的成员函数
①Nonstatic member functions
A non-static member function may be called for an object of its class type, or for an object of a class derived (Clause 10) from its class type, using the class member access syntax (5.2.5, 13.3.1.1).
非静态成员函数可以叫做类类型的对象,或者一个对象能够通过类类型来找到,通过类成员的使用语法
②The this pointer
Inthe body of a non-static (9.3) member function, the keyword this is a prvalue expression whose value is the address of the object for which the function is called.
Static members
A data or function member of a class may be declared static in a class definition, in which case it is a static member of the class.
在类中数据或者函数可能在类定义中被声明我静态的,这种情况下它叫做类的静态成员
①Static member functions
A static member function does not have a this pointer
静态成员函数没有this指针
A static member function shall not be virtual. There shall not be a static and a non-static member function with the same name and the same parameter
types (13.1). A static member function shall not be declared const, volatile, or const volatile.
静态成员函数规定不能是虚拟的,静态成员函数和非静态函数不能有相同的名字和相同的参数类型,静态成员函数不能被const,volatile,const volatile声明
②Static data members
A static data member is not part of the subobjects of a class.
一个静态数据成员不属于类的子对象
Derived classes
①Multiple base classes
A class can be derived from any number of base classes.
一个类可以派生任何数量的基类
②Virtual functions
Virtual functions support dynamic binding and object-oriented programming. A class that declares or inherits a virtual function is called a polymorphic
class.
虚函数支持动态绑定和面向对象编程.声明或继承虚函数的类称作多态类
③Abstract classes
A class is abstract if it has at least one pure virtual function.
一个类是抽象前提是至少有一个纯虚函数
Overloaded operators
operator: one of new delete new[] delete[] + - * / % ˆ & | ∼ ! = < > += -= *= /= %= ˆ= &= |= << >> >>= <<= == != <= >= && || ++ -- , ->* -> ( ) [ ]
标签:
原文地址:http://www.cnblogs.com/Susake/p/4691893.html