Boost logo

Boost :

From: Janek Kozicki (janek_listy_at_[hidden])
Date: 2007-02-13 03:54:30


Matthias Schabel said: (by the date of Tue, 13 Feb 2007 00:20:09 -0700)

> quantity<SI::length> getInput(const unit_enum& input_unit,double val)
> {
> typedef quantity<SI::length> return_type;
>
> switch (input_unit)
> {
> case FEET : return return_type(val*imperial::feet);
> case LEAGUES : return return_type(val*nautical::leagues);
> case METERS :
> default : return return_type(val*SI::meters);
> };
> }

I like this approach.

-- 
Janek Kozicki                                                         |

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