
9 Jan
2009
9 Jan
'09
10:23 p.m.
I have a method that takes a parameter of type quantity<feet> where feet is defined by the following typedef: typedef boost::units::us::foot_base_unit::unit_type feet; I also have this typedef: typedef bu::us::inch_base_unit::unit_type inches; Do I really need to define a typedef like this for every measurement type I want to use? I certainly don't want to specify all those namespaces every time I use one of the measurement types, but this approach seems a bit tedious. I'd like to do something like this: a.setWingspan(195*feet() + 8*inches()); but that doesn't work because there is no match for operator+. What's a good way to add inches to a feet quantity? --- Mark Volkmann