need help with boost::units

Hello,
I need some help with boost::units (here: https://github.com/boostorg/units). I have been able to use the library for basic tasks as compute sin(theta) with theta in rad or deg and produce the same result. I then tried the custom object example provided in measurement.hpp (here: https://github.com/boostorg/units/blob/develop/example/measurement.hpp), and here problems begin:
if I declare
quantity<plane_angle,measurement<double> > whatever;
all works as expected, but as soon as I declare
quantity<plane_angle,measurement<std::complex<double> > > whateverElse;
the file does not compile. I experienced the same with a custom 2 x 2 matrix class: if I use a <double> matrix all seem to work, but as soon as I use a <std::complex<double>> matrix the compiler complaints.

Does anyone have experience with this library? Which are the operators I must overload in a custom class in order to use if with units?

I put a (non) working example on GitHub (here: https://github.com/oLazy/some_garbage/blob/devel/z1amt/matrix22.h) and I will gladly appreciate any help on this issue.
Hi,

You links 404'd for me

Did you look at the complex.cpp example here

https://www.boost.org/doc/libs/1_68_0/doc/html/boost_units/Examples.html

It shows a replacement complex class, so I am guessing you need that, not std::complex.

Good Luck !!
Topic archived. No new replies allowed.