Cpp_Primer_Answers icon indicating copy to clipboard operation
Cpp_Primer_Answers copied to clipboard

7.36初始化顺序错误

Open YuDe95 opened this issue 5 years ago • 2 comments

YuDe95 avatar Nov 08 '19 01:11 YuDe95

struct x{ x(int i,int j)::rem(base%j),base(i) }

YuDe95 avatar Nov 08 '19 01:11 YuDe95

我认为这样会好些: struct x{ x(int i,int j):base(i),rem(i%j){} }

ZyoHuang avatar Mar 04 '20 06:03 ZyoHuang