What is the performance implication of converting to bool in C++?

前端 未结 11 848
后悔当初
后悔当初 2020-12-03 02:36

[This question is related to but not the same as this one.]

My compiler warns about implicitly converting or casting certain types to bool whereas explicit

11条回答
  •  再見小時候
    2020-12-03 03:01

    I don't think performance is the issue here. The reason you get a warning is that information is lost during conversion from int to bool.

提交回复
热议问题