Cannot cast to/from enum class


  • I have a simple enum class with a single member.  I cannot seem to cast to or from this enum.  Is there any way to do this cast?  I keep getting "An internal error has occurred in the compiler."
    Sunday, October 9, 2011 10:13 PM

All replies

  • Hello,

    Could you post the code where you are getting the internal error?  I tried a simple repro like but it ran fine


    enum class Test : unsigned int {

    enum class Test2 {

    int _tmain(int argc, _TCHAR* argv[])
     Test status;

     status = Test::Passed;

     int i;

     i = (int) status;
     cout << i << endl;
     Test2 color;

     color = Test2::Blue;

     i = (int) color;

     cout << i << endl;




    Tuesday, October 11, 2011 6:05 PM