The example that you give for using enum
's can be rewritten as:
struct Point
{
int x;
int y;
};
struct Box
{
Point p;
int width;
int height;
};
constexpr Box b = { { 1, 2 }, 3, 4 };
int f()
{
return b.p.x;
}
Using strong types instead of int
could even be a benefit.
For me this is more legible. I could even add some functions into that.