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

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

系統 2947 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條評論
主站蜘蛛池模板: 永胜县| 凤山市| 侯马市| 文昌市| 长宁区| 揭阳市| 台北县| 墨玉县| 改则县| 昭平县| 云龙县| 汉中市| 峨眉山市| 肥西县| 汶上县| 乌兰浩特市| 台州市| 察隅县| 阳谷县| 依安县| 社会| 思南县| 罗城| 姚安县| 昭苏县| 灵宝市| 社会| 万荣县| 泽库县| 法库县| 济源市| 岫岩| 新田县| 宝坻区| 泽库县| 瑞丽市| 郧西县| 鸡西市| 乌拉特后旗| 尤溪县| 阳城县|