Enum trick in C++/CLI
In native C++ we could use enum trick in class definition:

    namespace EFoo
    {
      enum { a = 10; };
    }

    class Foo
    {
       // Declare an array of 10 integers.
       int m_Arr[EFoo::a];  
    };


However, with managed enum in C++/CLI,

    public enum class EFoo
    {
      a = 10,
    };


EFoo::a couldn't be converted implicitly to int,
so the enum trick wouldn't be allowed.

Is there any workaround?


Thanks.
Enum trick in C++/CLI
===

In native C++ we could use enum trick in class definition:

    namespace EFoo
    {
      enum { a = 10; };
    }

    class Foo
    {
       // Declare an array of 10 integers.
       int m_Arr[EFoo::a];  
    };


However, with managed enum in C++/CLI,

    public enum class EFoo
    {
      a = 10,
    };


EFoo::a couldn't be converted implicitly to int,
so the enum trick wouldn't be allowed.

Is there any workaround?


Thanks.