
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Andy Little Sent: Wednesday, August 16, 2006 7:46 AM To: boost@lists.boost.org Subject: Re: [boost] Boost Units library preview
Hi Eric,
...
I'm not quite sure which way to take this. Does this mean that you consider the Quan UI unsatisfactory and beyond repair?
Well I'll put it this way. Let's say you have two library interface designs. The first design, A, is the hypothetically perfect library interface. The second design, B, is a tangible, real, albeit less than perfect design. The goal of course is to get B as close as possible to A. Now would it be easier to hack away at B or start from scratch with a new design called C? I decided to take the latter approach. Compare the library interface of Quan to my proposed design. I would be interested to know what you think.
The implementation is loosely based on the dimensional analysis example in David Abrahams and Alexei Gurtovoys TMP book The implementation can be seen here:
That's a start but it's not a straight jacket. In addition to seperating the concept of a 'quantity' from the concept of a 'measure', I wanted to allow the user to define dimensions and units in a free-form manner using a type sequence of base dimensions and units. The user can list the dimensions and units of the sequence in any order.
Tested in VC7.1 and VC8.0 of vthe two examples gave compile errors. Testing in gcc 4.0 gave a failed assertion at runtime
Like I said, it's a preview. I made it available in order to get comments and feedback regarding the design of the interface. It's not even close to being ready for real use.
Is the structure of a unit / conversion factor based on that in quan?. It certainly looks very similar.
Yes, same approach. (Only solution to the problem that has been devised AFAIK.) Eric.