J
Joseph Turian
I want to create several types of double, e.g. D1 and D2.
I want strong typing, such that a function defined for D1 will not
accept a D2 argument.
One solution is:
struct D1 {
double d;
};
However, the usage is cumbersome (I have to access member variable d),
I don't have any operators defined, and object creation is more
expensive than for native types (right?).
Can someone propose an alternate solution that enforces the type safety
I require?
Thanks,
Joseph
I want strong typing, such that a function defined for D1 will not
accept a D2 argument.
One solution is:
struct D1 {
double d;
};
However, the usage is cumbersome (I have to access member variable d),
I don't have any operators defined, and object creation is more
expensive than for native types (right?).
Can someone propose an alternate solution that enforces the type safety
I require?
Thanks,
Joseph