forward/strong enum in VS2010

后端 未结 2 1909
青春惊慌失措
青春惊慌失措 2020-12-10 01:14

At http://blogs.msdn.com/vcblog/archive/2010/04/06/c-0x-core-language-features-in-vc10-the-table.aspx there is a table showing C++0x features that are implemented in 2010 RC

相关标签:
2条回答
  • 2020-12-10 01:23

    I think I found the answer. I found "enum class" in the VS 2010 documentation under the keywords documentation. It's managed only--unsupported in real C++ builds. So it seems that they mean this C++0x feature is "partially done" in that it isn't done at all.

    0 讨论(0)
  • 2020-12-10 01:32

    I wondered about this one too, but my guess is that they're simply making use of an existing nonstandard extension in their compiler.

    VC10 (and older) accepts code like this:

    enum E : short { test };
    
    E val = E::test;
    

    That is, you're allowed to use the enum name as a namespace qualifier, and you're allowed to specify the type.

    As for forward-declared enums, the following compiles fine for me:

    enum E;
    

    without the type specifier

    0 讨论(0)
提交回复
热议问题