
13 Feb
2007
13 Feb
'07
3:53 p.m.
Janek Kozicki wrote:
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.
I wouldn't recommend it. It doesn't scale too well.