Re:Ask HN: What should a systems/low-level software engineer...
by barrkel on Friday January 11, 2019 @08:57AM
(#18883574)
C enum values are convertible from int; C++ enum values aren't. This is one of the biggest differences in fairly idiomatic C code and has been the case for a very long time (i.e. not dependent on newer C features not being in C++).
This compiles in C but not C++.
[ Parent
| on HN ]
Re:Ask HN: What should a systems/low-level software engineer...
by antaflos on Friday January 11, 2019 @10:33AM
(#18884165)
That's not the same code, is it? GP's code does not seem to compile in C++: https://godbolt.org/z/5oAIYE
But it does in C: https://godbolt.org/z/zdTKiE
Re:Ask HN: What should a systems/low-level software engineer...
by adrianN on Friday January 11, 2019 @10:38AM
(#18884214)
Try creating a foo https://godbolt.org/z/AlHDhg