Double Negation in C++

后端 未结 14 2968
你的背包
你的背包 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:07

    Is operator! overloaded?
    If not, they're probably doing this to convert the variable to a bool without producing a warning. This is definitely not a standard way of doing things.

提交回复
热议问题