日韩久久久精品,亚洲精品久久久久久久久久久,亚洲欧美一区二区三区国产精品 ,一区二区福利

warning C4482: 使用了非標準擴展: 限定名中使

系統 3163 0

來源: http://dev.firnow.com/course/3_program/c++/cppsl/2008619/126863.html

?雖然只是一個warning,但是看起來很不爽。。。。

MSDN上是這么說明的:
compiler warning (level 1) C4482
warning description:

使用了非標準擴展: 限定名中使用了枚舉“enum”
當引用類型內的枚舉時,無需指定枚舉的名稱。
文件范圍的枚舉定義相當于常量,也不需要限定名。

example: C4482(MS Visual Studio)

        // C4482.cpp



// compile with: /c /W1



struct S {

   enum E { a };

};



int i = S::E::a; // C4482



int j = S::a; // OK


      

NOTE:
warring C4482: nonstandard extension used: enum **** used in qualified name

enumeration:
1. Standard C++ does not allow enumeration names to be used as scopes (GCC: error)
Visual C++ is half-hearted on the matter. (warrning)
2. C# support enumeration names as scopes.

Workaround: (for MS Visual Stdio)
if you want to get rid of those obnoxious error message and you’re using MS Visual Studio, encompass your statement in #pragma directives. For example,

#pragma warning(push)
#pragma warning(disable : 4482)
... (your statement here) ...
#pragma warning(pop)

That tells the compiler not to report the C4482 warning for the code within the block.
You are essentially saying to the compiler, “Yes, I’m doing this intentionally. I know it’s not comply with the standard, but I want it done anyway. So build my project and quit your whining!”

warning C4482: 使用了非標準擴展: 限定名中使


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 京山县| 黎城县| 嘉兴市| 珠海市| 临桂县| 通州市| 西林县| 巴林左旗| 安远县| 常德市| 宜丰县| 满城县| 资源县| 喀喇沁旗| 加查县| 桐柏县| 青龙| 广宁县| 崇文区| 肇东市| 营山县| 灯塔市| 龙南县| 梁山县| 无棣县| 会泽县| 镇坪县| 平乡县| 汾阳市| 杭锦旗| 奈曼旗| 健康| 卢湾区| 克什克腾旗| 九龙城区| 卢龙县| 平安县| 日土县| 诸城市| 宁波市| 沙雅县|