C++ logical & operator

前端 未结 4 1794
不知归路
不知归路 2021-01-17 22:03

Is there a logical & operator in C++? e.g. an operator that works just as && except that it also evaluates later arguments even if some preceding ones have alrea

4条回答
  •  情歌与酒
    2021-01-17 22:20

    There is no logical &, only a bitwise &.

    if you want to avoid short-circuiting of logical statements, you need to use a proxy the won't be optimized away by the compiler to achieve it (such as a variadic meta-template).

提交回复
热议问题