Hi,
In order to avoid reinventing the wheel I was wondering if there is
any effort or there was any attempt to further abstract
boost::units::quantities from its unit system but with a given
dimension. That is, an object that can hold any
boost::units::quantity > with a given
Dimension fir any System.
For example (names are not ideal)
any a1 = 2.*si::meter; // RHS is type
quantitysi::length
any a2 = 2.*cgs::centimeter; //RHS is type
quantitycgs::length
any b1 = 2.3 * si::second; // ERROR.
or can hold any other quantity with length dimension (from any
system). A sort of boost::variant ,
quantity, ... >, (but since the list is of type is
not well defined maybe variant is not an options.)
I know that there are some unresolved issues, for example, what is the
result of a1 + a2, for which I have some solutions in mind. Anyway I
just was wondering if this was tried before. And if not, what would be
the best way to achieve it (boost::any? boost::variant?). (Note that
all quantity<Unit> types has always the sizeof a double.)
Alfredo