This returns a new empty class to which I can add attributes.
它返回一个新的空类,我能向此空类添加属性。
The compiler still has to allocate space for the empty class, right?
编译器仍然必须为空类分配空间,对吧?
Note that when the first element is an empty class, compressed_pair_imp returns *this.
请注意,当第一个元素为空类时,compressed_pair_imp返回 *this。
Here's the trick: Instead of containing the empty class as a member, the pair structure in Boost derives from the empty class.
技巧在于:不包含空类作为成员,Boost中的pair结构是从这个空类中派生出来的。
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.
我现在能向这新的空类填充属性,诸如字符串和数字类型(代表了角色的成分),以及这个类中常用的函数。
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.
我现在能向这新的空类填充属性,诸如字符串和数字类型(代表了角色的成分),以及这个类中常用的函数。
应用推荐