Boost logo

Boost :

From: Steven Watanabe (steven_at_[hidden])
Date: 2007-02-16 13:54:43


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


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