这个函数允许客户端请求对象提供关于自己的其它方面的指针,这个新指针同样指向不同的虚基类(也叫做接口)。
This function allows a client to ask the object for different pointers to itself that also point to different abstract base classes (also known as interfaces).
Widget(所有pygtk部件的基类)的一些foo方法在内部调用虚方法do_foo。
Several foo methods of gtk.Widget (the base class for all PyGTK widgets) internally call the virtual methods do_foo.
类包含或者继承一个或多个纯虚函数,这样的类就是抽象基类。
A class containing (or inheriting) one or more pure virtual functions is an abstract base class.
现在,我米要调用基类的构造函数,而不是成员函数虚函数。
Now Im going to call virtual function from constructor of Base class rather than member function.
在基类中可以通过将虚函数声明为纯虚函数的手段来定义抽象类,强制派生类在自己的类定义中实现虚函数的具体功能。
In a base class, abstract class is defined by declaring pure virtual function, a derived class must define all inherited pure virtual functions of its base classes to be concrete.
当你通过基类的指针来调用虚函数,技术也是一样的。
When you invoke calls through a pointer to the base class, the technique is the same.
这有效地隐藏了基类中的虚函数。
This effectively hides the virtual function in the base class.
当抽象类从基类继承虚方法时,抽象类可以使用抽象方法重写该虚方法。
When an abstract class inherits a virtual method from a base class, the abstract class can override the virtual method with an abstract method.
如果函数用作静态成员函数,则重命名该函数,以便不与基类虚函数冲突。
If the function was intended to be a static member function, rename it so it doesn't conflict with the base class virtual function.
类函数定义与基类中的虚函数同名,但参数的数目或类型不同。
A class function definition has the same name as a virtual function in a base class but not the same number or type of arguments.
派生类继承虚拟基类的虚函数的多个重写。
The derived class inherits more than one override of a virtual function of a virtual base class.
子对象多重继承自多个基类,每个基类都有虚函数,那么子类对象的内存布局是什么样的?
A function that is virtual in a base class is implicitly virtual in its derived classes. When a derived class overrides a virtual, the parameters in the base and derived classes must match exactly.
当使用与基类虚函数相同的名称进行声明时,成员模板函数不能是虚函数并且不能从基类重写虚函数。
Member template functions cannot be virtual functions and cannot override virtual functions from a base class when they are declared with the same name as a base class virtual function.
当使用与基类虚函数相同的名称进行声明时,成员模板函数不能是虚函数并且不能从基类重写虚函数。
Member template functions cannot be virtual functions and cannot override virtual functions from a base class when they are declared with the same name as a base class virtual function.
应用推荐