_declspec和__declspec之间的区别? [英] Difference between _declspec and __declspec?

查看:142
本文介绍了_declspec和__declspec之间的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有时会看到以两个下划线开头的关键字,其他时候只有一个。是否有什么区别?

I sometimes see keywords starting with two underscores and other times just one. Is there any difference?

推荐答案

我相信 _declspec 的相同Microsoft特定关键字 __ declspec 。从C ++标准的角度来看,两个下划线比这样一个扩展的单个下划线更正确。这是根据17.4.3.1.2 / 1:

I believe that _declspec is older name of the same Microsoft specific keyword __declspec. From a C++ Standard point of view, two underscores are more correct than a single underscore for an extension like this. That's according to 17.4.3.1.2/1:


某些名称和函数签名集合始终保留给实现:

Certain sets of names and function signatures are always reserved to the implementation:


  • 每个包含双下划线(_ _)或以下划线开头,后跟高位
    字母(2.11)的名称

  • 以下划线开头的每个名称都保留给实现,以用作
    全局命名空间中的名称。

这篇关于_declspec和__declspec之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆