Of initializer lists and type narrowing
初始化器列表和类型窄化(type narrowing)
Given this kind of semantics, using initializer lists should be preferred whenever possible.
由于采用这种语义,应该尽可能使用初始化器列表。
It's okay to use initializer lists to initialize scalar variables, and the usual rule of type narrowing applies in such cases.
可以使用初始化器列表对标量变量进行初始化,在这种情况下应用一般的类型窄化规则。
Initializer lists in new expressions.
可以在new表达式中使用初始化器列表。
Initializer lists in variable definitions.
可以在变量定义中使用初始化器列表。
Initializer lists in variable definitions.
可以在变量定义中使用初始化器列表。
应用推荐