Boost logo

Boost Users :

Subject: [Boost-users] [units] Adding two absolute units
From: Itzik (oranja_at_[hidden])
Date: 2015-12-30 07:49:34


Hello,

<obligatory appreciation on first post>
I started using Boost just for boost::units and I find new ways boost can
help me almost every day. So thanks for the great stuff!
</obligatory appreciation on first post>

My question to the board is why two absolute quantities (si::temperature (K)
in my case) can't be summed in boost::units?
I realized that this is a rule enforced by-design
(gmane.comp.lib.boost.user/71747), and I understand that it is probably not
a very common case, but I wanted my code to solve a simple formula which
requires adding up two absolute temperatures
(quantity<absolute<temperature>>).

Each temperature represents an Inlet temperature in a Heat Exchange system.
So even if converting one temperature to a relative type
(quantity<temperature>) might be a workaround, it seems like a forced misuse
to me.

Eventually it turned out that I was mistaken with the formula, and
subtraction was required instead, so there's no problem there.
Alas, there's also a much simpler use case: What if I want to average the
temperature of the last N readouts? Shouldn't boost::units support this
simple operation?

I have no formal physics education, but intuitively, adding two absolute
temperatures doesn't seem really like a mistake to me, even if it's an odd
thing to do.

Will appreciate your thoughts on the matter.


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