KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Why i can't use reinterpret_cast operator for such a cast? enum Foo { bar, baz }; void foo(Foo) { } int main() { // foo(0); // error: invalid conversion from 'int' to 'Foo' // foo(reinterpret_cast<Foo>(0)); // error: invalid cast from type 'int' to type 'Foo' foo(static_cast<Foo>(0)); foo((Foo)0); }
Tags (comma-separated)
Save Edits
Cancel