Short circuit of overloaded operator && and || in C++17

妖精的绣舞 提交于 2019-12-04 23:54:50

That statement is not about short-circuit evaluation. It's about the order of evaluating the operands.

Pre-C++17, the order for evaluating the operands of overloaded && and || was compiler-defined. C++17 defines an explicit order of evaluation of left-to-right for && and ||, whether they are overloaded or not.

Short circuit evaluation still only applies to the built-in operators.

Note that on the actual page you cited, the part that is highlighted is what is applied to a specific version. That part is about the sequencing order, not the part about short-circuit evaluation.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!