更新时间:2023-11-12 10:56:34
Test = default
将默认初始化其成员.
但是对于int
或float
类型,默认初始化不同于值初始化
Test = default
will default initialize its members.
but for type as int
or float
, default initialization is different than value-initialization
如此
Test t; // t.s and t.m have unitialized value
而
Test t{}; // t.s == 0 and t.m == 0.0f;