【发布时间】:2011-04-06 09:02:06
【问题描述】:
在阅读 DirectWrite 源代码时,我发现了以下结构:
/// <summary>
/// Line breakpoint characteristics of a character.
/// </summary>
struct DWRITE_LINE_BREAKPOINT
{
/// <summary>
/// Breaking condition before the character.
/// </summary>
UINT8 breakConditionBefore : 2;
/// <summary>
/// Breaking condition after the character.
/// </summary>
UINT8 breakConditionAfter : 2;
/// <summary>
/// The character is some form of whitespace, which may be meaningful
/// for justification.
/// </summary>
UINT8 isWhitespace : 1;
/// <summary>
/// The character is a soft hyphen, often used to indicate hyphenation
/// points inside words.
/// </summary>
UINT8 isSoftHyphen : 1;
UINT8 padding : 2;
};
注意每个成员声明后奇怪的“:”。我将假设它是成员变量的默认初始化值。
我尝试在 Google 上搜索以确认,但由于不知道它的确切名称,我没有走多远(大多数结果与默认初始化有关)。
这种技术叫什么名字?
【问题讨论】:
-
它们只是“奇怪”的,因为你不知道它们是什么。 :)