
AMDG Matthias Schabel wrote:
//get Real part from 'tension' and pretend it's a current quantity
phony_tension = tension.value().real * amperes;//compiler doesn't complain, but how do I prevent this to compile? As soon as you use the value member function you have stripped out all unit information. Then, by multiplying by amperes, you are telling the compiler that this quantity is a current. It's not clear to me what you are trying to do here...the real part should still have units of electric potential. You might find reversing the nesting useful :
typedef std::complex
> tPotencial;
I thought that the operators for std:;complex can't deduce the return type correctly for Boost.Units. Anyway "The effect of instantiating the template complex for any type other than float, double or long double is unspecified." (26.2) In Christ, Steven Watanabe