Boost logo

Boost :

From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2007-03-29 18:46:09


Steven Watanabe wrote:
> AMDG
>
> Noah Roberts <roberts.noah <at> gmail.com> writes:

>> What is your evaluation of the potential usefulness of the library?
>>
>> It would be more useful with runtime conversions. I don't believe
>> static conversions will be that useful.
>
> Sorry for being so dense but, I still don't
> really understand the case for runtime
> conversions. Do you think you can provide me with a
> concrete case that I cannot solve easily using the
> current library?

Since any problem can be solved under almost any circumstance, no.

The problem I see is that to use this library I have to replicate the
unit system for runtime. Instead of having support in the library I
have to find a way to interact with it. Since this is the more
important aspect for me, and I believe many others, and providing the
dimensional safety is rather trivial, attempting to wrap this library to
provide runtime conversion support seems like too much work.

The problem simply is that most software needs to do conversions at
runtime. This set far outweighs those that use units but do not need
this. Since runtime support can be implemented so that it has a
negligible impact on performance I am unconvinced of the utility of a
library that only deals with it at compile time.

> The library is powerful enough to make conversion to
> a fixed system from some system that is known at
> runtime easy, *provided that the set of possible systems
> is known at compile time* (though not necessarily in
> a single monolithic definition). If this is not what
> you need, would you mind elaborating?

There is one use case that we have in our products that is not covered
by that. User defined units. These are specified as some conversion to
an arbitrary base we set up. There would need be room for this. In
fact I can see many situations in which the user should be able to enter
arbitrary units. We only allow two such in our main product but I do
know of a recipe book software that allows any unit to be entered; when
examining the genericness of this library such programs should certainly
be included in the set of those that would find a unit library
useful...scientific and real time computing is not a wide enough view
when looking at boost inclusion in my opinion.

Your idea of a allowing the unit override might solve may of my
objections. I would have to review that feature as it came. When I was
looking at this library it did not seem at all straight forward to do so.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk