|
Boost Users : |
Subject: Re: [Boost-users] Units: adding quantities
From: peter_foelsche_at_[hidden]
Date: 2009-01-09 17:41:28
I would not want to write any software that internally calculates with non-metric units.
-----Original Message-----
From: boost-users-bounces_at_[hidden] [mailto:boost-users-bounces_at_[hidden]] On Behalf Of Mark Volkmann
Sent: Friday, January 09, 2009 14:24
To: Boost-users_at_[hidden]
Subject: [Boost-users] Units: adding quantities
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 _______________________________________________ Boost-users mailing list Boost-users_at_[hidden] http://lists.boost.org/mailman/listinfo.cgi/boost-users
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net