加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

为什么>?=和<?=不能在VC中工作?

发布时间:2020-12-16 10:44:58 所属栏目:百科 来源:网络整理
导读:为什么?=和?=在VC中不起作用? 但它们在 gcc / g下工作正常 喜欢:a?= b; 他们是正确的用法吗? 解决方法 因为那些是最小和最大的旧 GC++-specific extensions. 从6. Extensions to the C++ Language开始: The GNU compiler provides these extensions t
为什么>?=和<?=在VC中不起作用?
但它们在 gcc / g下工作正常
喜欢:a>?= b;
他们是正确的用法吗?

解决方法

因为那些是最小和最大的旧 GC++-specific extensions.

从6. Extensions to the C++ Language开始:

The GNU compiler provides these extensions to the C++ language (and you can also use most of the C language extensions in your C++ programs). If you want to write code that checks whether these features are available,you can test for the GNU compiler the same way as for C programs: check for a predefined macro __GNUC__. You can also use __GNUG__ to test specifically for GNU C++ (see section ‘Predefined Macros’ in The GNU C Preprocessor).

> 6.1 Minimum and Maximum Operators in C++ C最小和最大运算符.
> ……

相反,你应该使用std :: min和std :: max.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读