Boost logo

Boost :

From: Jan Langer (jan_at_[hidden])
Date: 2004-01-09 05:09:20


Andy Little wrote:
> std::complex<q_impedance::R> Z=
> std::complex<q_voltage::V>() / std::complex<q_current::I>().
>
> No idea if that would actually work though.... Anybody ...?

it is correct. but i would prefer

typedef std::complex <double> value_type;
voltage <value_type> v (value_type (2, 3));
current <value_type> i (value_type (1, 4));
impedance <value_type> z = v / i;

my point is just that std::complex <double> is the value type and should
replace your implicit (i know its only for convenience) double.
jan

-- 
jan langer ... jan_at_[hidden]
"pi ist genau drei"

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk