You do not create an enumeration with this syntax. Instead, you use alternative explicit syntax syntax for translating from UINT32 to enum class X For example, you can explicitly use double for int as follows:
double p = 0.0; int f = int(p)
See this post for all syntax syntax you can use in C ++.
Your code can be equivalently written with more common syntax syntax as follows:
UINT32 id; enum class X {apple, pear, orange}; X myX = (X)id;
source share