3 ms·
enum class Handle : uint32_t { Invalid = 0 }; // process({10}); // error process(Handle{10}); > In C++14, you could use process(static_cast<Handle>(10
by patrick451 2y ago
enum class Handle : uint32_t { Invalid = 0 };
// process({10}); // error
process(Handle{10});
> In C++14, you could use process(static_cast<Handle>(10)); so, as you can see, the C++17 version is much better.
100% disagree that the c++17 version is better. It just lets you right broken code that doesn't look broken.
- account42 2y agoAgreed, this isn't something that should be encouraged with a nicer syntax.