这个GNU对三元运算的扩展有多广泛? [英] How wide-spread is this GNU extension on ternary operation?
本文介绍了这个GNU对三元运算的扩展有多广泛?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是根据维基百科的三方操作的GNU扩展。
This is a GNU extension on ternary operation according to the Wikipedia.
iMyVal = --iVal ?: iDft;
虽然我完全知道这是一个GNU扩展,但有时事情可能会非常方便
While I'm fully aware that this is a GNU extension, but sometimes things may come in very handy with this special syntax.
那么,有没有人知道这个语法是否只在 gcc
中可用?或者是支持它的任何其他编译器?
So, does anybody know if this syntax is only available in gcc
? Or are they any other compilers which support it?
给任何有兴趣的人,PHP从5.3开始支持此语法
提前感谢。
推荐答案
一些答案:
- GCC - 是
- MSVC - 否(基于vanetto的回答)
-
>无是 - LLVM在线编译器已成功编译。 - Intel C编译器 - 是
- GCC - yes
- MSVC - no (based on vanetto's answer)
- CLANG -
noyes - the LLVM online compiler compiles it successfully. - Intel C compiler - yes
底线 - 不广泛。只有英特尔的编译器,几乎100%gcc兼容,支持这一点。?
这篇关于这个GNU对三元运算的扩展有多广泛?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文