|
Boost : |
From: Daniel Frey (d.frey_at_[hidden])
Date: 2004-01-08 18:39:25
On Thu, 08 Jan 2004 21:30:42 +0100, Matthias Schabel wrote:
>> This looks very nice so far, but I have one question: Why is <Y>
>> attached to SI instead of:
>>
>> template<class Y>
>> typename SI::quantity<Y>
>> idealGasLaw(typename SI::pressure<Y> P,
>> typename SI::volume<Y> V,
>> typename SI::temperature<Y> T)
>> {
>> return (P*V/(8.314*(_joules/(_kelvin*_mole))*T));
>> }
>>
>> as it is AFAICS not part of the SI-model to define the number-type. Or
>> was this just a typo?
>
> Not a typo, but also no particular reason that I can think of off the
> top of my head. Let me think about this for a while. From my
> standpoint, the specific details of the syntax are not crucial (though I
> _hate_ the non-namespace pq_ decorated approach and, as I already
> mentioned, vastly prefer full names to weird, terse abbreviations).
I think the <Y> should be part of quantity, etc., because for all
those types, I need it exported as ::scalar_type or something to be able
to define the constants the right way. At least I think so at the moment,
but I haven't tried it yet. But the above is a very good example which I
will probably use for the constant library's documentation and it also
inspired some more ideas for features. But I'll have to explore that in
more detail.
> BTW, small quibble : at least in the US the ideal gas
> constant symbol commonly used is R. It would be great to be able to use
> boost::chemistry::R and so on and have it DTRT...
Well, R or G doesn't matter to me as I don't have a clue about chemisty.
If you say it's R, than it's R. But I like firework ;)
Regards, Daniel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk