I was surprised when doing the following that no assembly is produced for the Enums
:
I thought perhaps it would do something like:
Hello:
.byte 0
Goodbye:
.byte 1
It seems it only adds in the values when assigned to a var:
Why is this so? Why don't the 'enum values' get stored when declared (even if I set Hello=1
)? Example link: https://godbolt.org/z/xxnMvq.