• 第26 - 34行:虚函数。

    Lines 26-34: Virtual functions.

    youdao

  • 第二次,进程只是引用数据成员和虚函数。

    The second time, the process simply references the data members and virtual functions.

    youdao

  • 这有效地隐藏了基类中的虚函数。

    This effectively hides the virtual function in the base class.

    youdao

  • 讨论和示例程序都只限于非静态数据成员和虚函数。

    The discussion and the sample program are limited to non-static data members and virtual functions.

    youdao

  • 派生类可以有两套虚函数?

    Can derived class have two sets of virtual functions?

    youdao

  • 但是,在某些情况下,不可能使用虚函数。

    In some situations however, the use of virtual functions is not possible.

    youdao

  • 在头文件中为该虚函数所生成的代码如列表2中所示。

    The code generated for the virtual function in a header file is shown in Listing 2.

    youdao

  • 派生类继承虚拟基类的虚函数的多个重写。

    The derived class inherits more than one override of a virtual function of a virtual base class.

    youdao

  • 讨论在派生类中处理私有虚函数的方式的更改。

    Discusses changes in the way private virtual functions are handled in derived classes.

    youdao

  • 编译器用正确的函数地址初始化这些虚函数表。

    The compiler initializes these tables with the correct function addresses.

    youdao

  • 当你通过基类的指针来调用虚函数,技术也是一样的。

    When you invoke calls through a pointer to the base class, the technique is the same.

    youdao

  • 这样,使用虚函数的对象每个实例占用4个额外的字节。

    Thus an object that USES virtual functions occupies 4 additional bytes for each instance.

    youdao

  • 类包含或者继承一个或多个纯虚函数,这样的类就是抽象基类。

    A class containing (or inheriting) one or more pure virtual functions is an abstract base class.

    youdao

  • 发出错误信息,如果有人试图构建一个明确对象或调用虚函数。

    The error message is issued if someone tries to explicitly construct an object or call a virtual function.

    youdao

  • 类函数定义与基类中的虚函数同名,但参数的数目或类型不同。

    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.

    youdao

  • 所谓虚类或虚函数是指应用程序以后需要,但是目前还没写的代码。

    A virtual class or function is code that the application will eventually need, but it isn't written yet.

    youdao

  • 清单1定义了三个类(A、b和c),它们有一个共同的虚函数whoami 。

    Listing 1 defines three classes (a, B and c) with a common virtual function WhoAmI .

    youdao

  • 当使用虚函数的时候,编译器自动根据对象的实际类型选择正确的函数。

    When we use virtual functions, the compiler automatically selects the right function according to the actual type of the object.

    youdao

  • 如果函数用作静态成员函数,则重命名该函数,以便不与基类虚函数冲突。

    If the function was intended to be a static member function, rename it so it doesn't conflict with the base class virtual function.

    youdao

  • 使虚函数内联的主要原因在于类定义,主要是方便的原因,比如说成员访问函数。

    The main reason for making a virtual function inline is to place its definition in the class, either for convenience or to document its behavior, e. g., for accessors and mutators.

    youdao

  • 继承层次关系的根类应该定义虚函数性质的析构函数,即使这个析构函数不做任何的事情。

    The root class of an inheritance hierarchy should define a virtual destructor even if the destructor has no work to do.

    youdao

  • 客户端或服务器端最重要的部分是虚函数NotifyReceivedPackage,定义如下。

    The most important part of the client or server code is the virtual function NotifyReceivedPackage, as described below.

    youdao

  • 使用动态强制类型转换要小心。只要有可能,定义和使用虚函数比直接接管类型管理好得多。

    Dynamic casts should be used with caution. Whenever possible, it is much better to define and use a virtual function rather than to take over managing the types directly.

    youdao

  • 子对象多重继承自多个基类,每个基类都有虚函数,那么子类对象的内存布局是什么样的?

    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.

    youdao

  • 首先,Vee -Table指针用于访问虚函数,而对数据成员的访问直接使用编译时偏移量实现。

    First, the Vee-Table pointer is used to access virtual functions, and data members are accessed directly using compile time offsets.

    youdao

  • 本课程主要内容包括类和对象、关联和聚合、继承、虚函数和多态性、综合设计等相关实验。

    This course mainly covers classes and objects, association and aggregation, inheritance, polymorphism, comprehensive design and other related experiments.

    youdao

  • 对于带虚函数的类,在运行时执行rtti操作符,但对于其他类型,在编译时计算rtti操作符。

    The RTTI operators execute at run time for classes with virtual functions, but are evaluated at compile time for all other types.

    youdao

  • 如果函数是虚函数,并且调用是通过引用或者指针,编译器基于动态类型生成代码确定调用哪个版本。

    If the function is virtual and the call is through a reference or pointer, then the compiler generates code to determine which version to run based on the dynamic type of the object.

    youdao

  • 知道哪些函数即使你声明了内联也不会内联很重要:比如说虚函数和递归函数在一般情况下不会内联。

    It is important to know that functions are not always inlined even if they are declared as such; for example, virtual and recursive functions are not normally inlined.

    youdao

  • 知道哪些函数即使你声明了内联也不会内联很重要:比如说虚函数和递归函数在一般情况下不会内联。

    It is important to know that functions are not always inlined even if they are declared as such; for example, virtual and recursive functions are not normally inlined.

    youdao

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定