
16 Feb
2007
16 Feb
'07
6:54 p.m.
AMDG Matthias Schabel <boost <at> schabel-family.org> writes:
std::cout << ((x + y) * user_selected_unit) << std::endl;
How is this different from/better than
std::cout << quantity<your_system::psi>(x+y) << std::endl;
or, if you prefer,
typedef quantity<your_system::psi> psi;
std::cout << psi(x+y) << std::endl;
??
The unit is fixed at compile time that way. In some programs you may want the user to specify what units he wants the result to be in. In Christ, Steven Watanabe