acceptable fix for majority of signed/unsigned warnings?

后端 未结 7 585
清酒与你
清酒与你 2021-01-12 03:32

I myself am convinced that in a project I\'m working on signed integers are the best choice in the majority of cases, even though the value contained within can never be neg

7条回答
  •  南笙
    南笙 (楼主)
    2021-01-12 03:53

    vector.size() returns a size_t var, so just change int to size_t and it should be fine.

    Richard's answer is more correct, except that it's a lot of work for a simple loop.

提交回复
热议问题