在阅读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;
};
Run Code Online (Sandbox Code Playgroud)
在每个成员声明之后,请注意一个奇怪的“:”。我将假定它是成员变量的默认初始化值。
我尝试搜索Google进行确认,但是却不知道到底叫什么(大多数结果与默认初始化有关)。
此技术的名称是什么?