编译器仍然必须为空类分配空间,对吧?
The compiler still has to allocate space for the empty class, right?
它返回一个新的空类,我能向此空类添加属性。
This returns a new empty class to which I can add attributes.
清单3.pair中使用的空类占用了更多内存。
为可空类型提供类库支持,包括转换运算符和算术运算符。
Library Support for nullable types, including conversion operators and arithmetic operators.
root 基本上是一个空类,实际上是站点根URL的占位符。
The near empty class root is really a placeholder for the root URL of your site.
thing是最通用的类,它包括了一切东西;owl:Nothing是一个空类。
Owl: thing is the most general class, which contains everything; owl: Nothing is an empty class.
技巧在于:不包含空类作为成员,Boost中的pair结构是从这个空类中派生出来的。
Here's the trick: Instead of containing the empty class as a member, the pair structure in Boost derives from the empty class.
请注意,正如您所预期的那样,compressed _pair _ imp派生自空类。
Note that, as expected, the compressed_pair_imp is derived from the empty class.
请注意,当第一个元素为空类时,compressed_pair_imp返回 *this。
Note that when the first element is an empty class, compressed_pair_imp returns *this.
这样就添加了一个名为Class_1的空类,稍等片刻后就可以输入类名person了。
A blank class named Class_1 is added; wait a few moments and you will be able to enter the class name Person.
我现在能向这新的空类填充属性,诸如字符串和数字类型(代表了角色的成分),以及这个类中常用的函数。
I can now fill the new empty class with attributes such as string and number types (representing the elements of the character), as well as functions common to this class.
与可怕的空指针异常(该异常除了报告空指针之外,对于将要发生的事情什么也不说)不同,类强制转换异常相对来说容易调试。
Unlike the dreaded null-pointer exception (which says nothing about what was expected to occur instead of the null pointer), a class-cast exception is relatively easy to debug.
空的finalizer(它抵消超类finalizer的作用)。
An empty finalizer (which negates the effect of the superclass finalizer).
然而,我发觉首先创建带有一些空方法的类文件,然后生成测试文件是很容易的。
However, I find it easier to create the class file first, with some empty methods, and then create the test file.
清单5给出的代码在优化了空基类的编译器上证明了这一点。
Listing 5 shows the code that proves the point on compilers optimizing empty base classes.
您可以使用一个抽象超类,在其中包含所有访问者的所有类的空实现,从而略微缓解难度。
You can alleviate this somewhat by having an abstract superclass that contains empty implementations of all methods for all visitors.
您如何知道一个类是否是空的?
它在两个域中都放置一个空指针来表示空链表,而不是为空链表定义一个单独的类。
Instead of defining a separate class for empty lists, it represents empty lists by putting a null pointer in both fields.
例如,表示非空容器的任何类在构造函数中必然使用表示其元素的参数。
For instance, any class representing a non-empty container would naturally take arguments representing its elements in the constructor.
例如,不像一个类转型异常,空指针异常不给出它所需要的内容的任何信息,只有一个空指针。
Unlike, for example, a class-cast exception, a null-pointer exception says nothing about what was expected instead of the null pointer.
此包装类会在超出范围或设置为空时丢弃其到数据对象的连接。
This wrapper class drops its connection to the DataObject when it goes out of scope, or gets nulled.
相反,在运行时发出的错误将会是一个空指针异常而不是类强制转换异常。
Instead, the error signaled at run time would be a null-pointer exception instead of a class-cast exception.
他今年的策略是作空金融类股,这种做法具有很大的下行风险。
His strategy this year has involved shorting financial shares, an approach with greater downside risk.
其他的特性还包括类不变量、非空引用类型和加强的静态分析功能。
Other features include class invariants, non-nullable reference types, and enhanced static analysis capabilities.
优点包括数据表比较紧凑(没有不需要的可空字段),数据跨三个子类的表进行分区,容易使用超类的表与其他表进行关联。
The pros include compact tables (no unnecessary nullable columns), data partitions across three subclass tables and easy association with other tables using the top super class table.
罗奇说,我不会持有资源类股,我会做空实物铜。
'I would not own resource companies, and I would short physical copper,' Roche said.
毕竟,我们不必仅仅为了空链表而去定义一个额外的类。
After all, we've saved the effort of having to define an extra class just for empty lists.
清单9基于编译器会优化空基类的假设。
Listing 9 is based on the assumption that the compiler optimizes away the empty base classes.
对于每种模式,portletadapter类都提供一个缺省的空实现方法。
For each mode, the PortletAdapter class provides a default empty implementation method.
对于每种模式,portletadapter类都提供一个缺省的空实现方法。
For each mode, the PortletAdapter class provides a default empty implementation method.
应用推荐