相关疑难解决方法(0)

没有中间表达的三元运算符

最近,我意识到,你可以使用GCC和铛三元运营商没有中间(?:? :工程),它会插入第一个表达式到中:

// outputs 2
cout << (2 ?: 4);
// outputs 3
cout << (0 ?  : 3);
Run Code Online (Sandbox Code Playgroud)

这个标准在哪里?我看了,没看到任何关于它的事.

c++ gcc ternary-operator clang conditional-operator

9
推荐指数
1
解决办法
842
查看次数

标签 统计

c++ ×1

clang ×1

conditional-operator ×1

gcc ×1

ternary-operator ×1