(See reply at bottom) ----- Original Message ----- From: "Steven Watanabe" <watanabesj@gmail.com> Newsgroups: gmane.comp.lib.boost.user To: <boost-users@lists.boost.org> Sent: Wednesday, May 19, 2010 1:17 PM Subject: Re: [units] How to assign "ft" to an si::length?
AMDG
Terry Golubiewski wrote:
I am having trouble seeing how to use mixed units. The program below compiles and runs. See the changes I "wish" I could make as comments.
terry
<snip>
Warning: untested code
typedef quantty<us::foot_base_unit::unit_type> Length; Length x(2.0 * m);
In Christ, Steven Watanabe
Ok. That makes Length represent "feet" But I want Length to remain represented as an si::length, but input "ft" into it and convert to "ft" to print. // static const si::length ft = ???; typedef quantity<si::length> Length; Length x = 3.0 * ft; cout << "x=" << convert_to_ft(x) << endl; terry