I've recently started working the C++/CLI managed code, but I've always defined enums like so:
enum FV_MODE
{
IDLE,DRAG,ADD_HITBOX,ADD_HURTBOX
};
Until today, when I was hit with the error message:
cannot define an unmanaged enum 'FViewer::FV_MODE' inside managed 'FViewer'
1> use 'enum class'
As suggested in the message and on various Stack Overflow questions, changing my code to:
enum class FV_MODE
{
IDLE,DRAG,ADD_HITBOX,ADD_HURTBOX
};
quickly fixed the problem.
However, I'm still unaware of the differences between the 2 different ways I now know to define enums. Could anybody help clarify for me? And also what makes "enum class" more suitable for managed code?
Thanks in advance,
Guy