If I have an C++ enum:
enum Foo { Bar, Baz, Bork, };
How do I tell the compiler to use a uint16_t to actually store the
uint16_t
In C++11, you can do that:
enum class Foo : uint16_t { Bar, Baz, Bork, };
Later on, you can also know the underlying type of the enum as:
#include std::underlying_type::type v = 10; //v is uint16_t