Hacker News new | ask | show | jobs
by kgilpin 2616 days ago
You could do this in C++ by storing the unit of measure with the measurement value and then performing unit conversion in overloaded math operators.