
1 Sep
2009
1 Sep
'09
9:10 a.m.
Hi all! Is there an easy way to check if two quantities have the same dimension? E. g. a user enters a weight in tons and asks for a conversion to kilograms. So now at run time I would like to know if tons and kilograms have the same dimensions (i. e. are convertable) or not (illegal conversion). Thanks, Thomas

1 Sep
1 Sep
2:28 p.m.
AMDG Thomas Taylor wrote:
Is there an easy way to check if two quantities have the same dimension?
E. g. a user enters a weight in tons and asks for a conversion to kilograms. So now at run time I would like to know if tons and kilograms have the same dimensions (i. e. are convertable) or not (illegal conversion).
Each unit has a nested dimension_type typedef. Use it with boost::is_same. In Christ, Steven Watanabe
5691
Age (days ago)
5691
Last active (days ago)
1 comments
2 participants
participants (2)
-
Steven Watanabe
-
Thomas Taylor