C++ 警告:条件的第二个/第三个操作数无效[-Wunused value]
怎么了?您的代码转换为:C++ 警告:条件的第二个/第三个操作数无效[-Wunused value],c++,gcc,operator-precedence,C++,Gcc,Operator Precedence,怎么了?您的代码转换为: second operand of conditional expression has no effect [-Wunused-value] third operand of conditional expression has no effect [-Wunused-value] 或 我的意思是std::cout second operand of conditional expression has no effect [-Wunused-value] thir
second operand of conditional expression has no effect [-Wunused-value]
third operand of conditional expression has no effect [-Wunused-value]
或
我的意思是std::cout
second operand of conditional expression has no effect [-Wunused-value]
third operand of conditional expression has no effect [-Wunused-value]
((std::cout << (abs(b - c) < a)) && a < b + c) ? 1 : 0;
std::cout << (abs(b - c) < a && a < b + c ? 1 : 0);
// same as std::cout << ((abs(b - c) < a && a < b + c) ? 1 : 0);
std::cout << (abs(b - c) < a && (a < b + c ? 1 : 0));
std::cout << (abs(b - c) < a && a < b + c);