Re: [boost] Boost Units library preview

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Deane Yang Sent: Monday, August 21, 2006 4:28 PM To: boost@lists.boost.org Subject: Re: [boost] Boost Units library preview
...
My main objection to this is that I am pretty sure that a quantity/units library that does not do implicit unit conversion is a *lot* easier to implement than one that does. And it's hard for me to believe that a library that does automatic unit conversion doesn't have inside of it a simpler non-automatic unit conversion library. So implementing explicit unit conversion on top of an implicit conversion library seems, well, backwards.
Not really. The implementation that I used is that, internally, all arithmetic values are stored in a standard unit (typically the SI unit). Only when an arithmetic value is assigned to or retrieved from the object is a conversion operation actually required. All other arithmetic operations can therefore be oblivious to conversion operations. So doing the conversions up front actually simplifies the implementation. Eric.
participants (1)
-
Eric Lemings