Enum clarification

hello,
When i watch tutorials i try to figure out what the instructor is going to do and race to do it before them.
so when i heard that we need to bind the “Grab” action i rushed and typed “…BindAction(“Grab”,EInputEvent::IE_Pressed…”. then when it came up in the video i noticed the enum option was called without the enum type name "…BindAction(“Grab”,IE_Pressed…"
now, i’ve been programming in C# for 9 years and it all seems too weird to me.
can someone please explain how is it possible? is it safer to use it this way?
thanks!

Hey there!

In C++ you have regular enumerators and enum classes. When using traditional enums, the values are unique (multiple enums cannot have the same enumerator) and available within the scope in which they are defined. enum classes behave more as you expected.

I invite you to take a look at the remarks and the first code sample that follows on this MSDN page: enums

Hope this helps!

1 Like

Privacy & Terms