Почему я не могу использовать оператор reinterpret_cast для такого приведения?
enum Foo { bar, baz };
void foo(Foo)
{
}
int main()
{
// foo(0); // error: invalid conversion from 'int' to 'Foo'
// foo(reinterpret_cast(0)); // error: invalid cast from type 'int' to type 'Foo'
foo(static_cast(0));
foo((Foo)0);
}
Подробнее здесь: https://stackoverflow.com/questions/122 ... r-for-enum