
//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)
Right, as usual... Maybe flesh out the more flexible complex type that we provided in our example or lobby the standards committee to make std::complex less stupid? Is there any good reason to have unspecified behavior for std::complex for UDTs? Matthias