Why do I get an error when directly comparing two enums?

后端 未结 4 1815
闹比i
闹比i 2021-02-13 20:09

I have some code I\'m porting to a new platform, and it started giving me an error about comparing two enumerators from two different enumerator-lists. I\'m confused why it\'s g

4条回答
  •  被撕碎了的回忆
    2021-02-13 21:04

    if((int)myf == (int)mys)

    That should do it. But it is dirty practice, only use it if both enums are different "versions" of the same group, like the newer one would contain new keywords at the end.

提交回复
热议问题