|
Boost : |
From: Noah Roberts (roberts.noah_at_[hidden])
Date: 2007-02-13 10:53:30
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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk