我在某个库中找到了表达式enum-type-name ( integral-value ),但它看起来有点奇怪,它真的是它的样子吗(至少对我来说)?枚举类型可以称为函数,还是只是另一种类型的枚举类型?或者是什么?例如:
enum SomeEnum
{
SOMETHING = 0,
OTHERTHING = 1
};
void someFunction(SomeEnum e)
{
// ...
}
someFunction( 2 ); // Invalid conversion
someFunction( (SomeEnum)2 ); // Works, Normal casting
someFunction( SomeEnum(2) ); // Works!! calling the enum as a function?? or just another style of enum casting??