I’m thinking of creating a class for lbs and a separate class for kg which both inherit from integer but don’t add anything to them. This would allow the compiler to verify the right units are passed to functions.
Is this the best approach or is there a better way of doing this?
Personally I would have a class called
Massor something similar, and have methods that would return the object’s value in one unit or another.