I accidently wrote
if (myEnum1 < myEnum2)
{
//do etc.
}
and I got no compiler errors. Shouldn't I have to cast these enums to their underlying types first:
if ((int) myEnum1 < (int) myEnum2))
{
//do etc.
}
Are these two snippets equivalent? My IDE, Jetbrains Rider, doesn't seem to think so. I can't jump to the < definitions so I assume it's a compiler thang'?