Double Negation in C++

后端 未结 14 2667
你的背包
你的背包 2020-11-22 10:40

I just came onto a project with a pretty huge code base.

I\'m mostly dealing with C++ and a lot of the code they write uses double negation for their boolean logic.

14条回答
  •  太阳男子
    2020-11-22 11:11

    The coders think that it will convert the operand to bool, but because the operands of && are already implicitly converted to bool, it's utterly redundant.

提交回复
热议问题