标签: c++ struct initialization static-members initializer-list
如果我有struct:
struct
struct Vec2{ double _x; double _y; };
我可以像这样初始化:
Vec2 foo = {13.0, 42.0};
但如果我有这个struct怎么办?
struct Vec2{ static const double INVALID; double _x; double _y; };