I recently started working with C ++ / CLI managed code, but I always defined enums as follows:
enum FV_MODE { IDLE,DRAG,ADD_HITBOX,ADD_HURTBOX };
Until today, when I received the error message:
cannot define an unmanaged enum 'FViewer::FV_MODE' inside managed 'FViewer' 1> use 'enum class'
As stated in the post and on various issues, changing my code to:
enum class FV_MODE { IDLE,DRAG,ADD_HITBOX,ADD_HURTBOX };
quickly fixed the problem.
However, I still don't know the differences between the two different ways that I now know to define enumerations. Can someone help clarify me? And also what makes the "enum class" more suitable for managed code?
Thanks in advance,
Guy
source share