Boost Users :
Subject: Re: [Boost-users] [units] Adding two absolute units
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2016-01-02 23:20:22
On Fri, Jan 1, 2016 at 9:25 AM, Itzik <oranja_at_[hidden]> wrote:
> So I was hoping to get the reasoning behind the exclusion of the operators
> '+' and '/' for absolute quantities. In my eyes there's not much difference
> between summing two absolute quantities of mass density and two absolute
He gave the explanation. Adding two absolute quantities does not, itself,
have meaning, or at least not as an absolute quantity. If you allow that
operation directly, you're just introducing a way for users to make a
mistake that otherwise would have been correctly caught at compile time.
These are some of the kinds of errors that such a unit library aims to
prevent, so allowing the operation would go against the idea of the library.
-- -Matt Calabrese
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