Boost logo

Boost Users :

Subject: Re: [Boost-users] [units] Proposal for generalizing scales
From: Manoj Rajagopalan (rmanoj_at_[hidden])
Date: 2009-09-17 13:29:07


On Thursday 17 September 2009 11:02:47 am Steven Watanabe wrote:
>
> In this case it's probably easier to define a new
> base unit and use the conversion macros, which
> can accept a double. (Warning untested)
>
> struct electron_volt_base_unit : base_unit<electron_volt_base_unit,
> energy_dimension, 43289> {
> static const char* name() { return "electron-Volt"; }
> static const char* symbol() { return "eV"; }
> };
>
> BOOST_UNITS_DEFINE_CONVERSION_FACTOR(electron_volt_base_unit,
> si::energy, double, 1.602e-19);
> BOOST_UNITS_DEFAULT_CONVERSION(electron_volt_base_unit, si::energy);
>

I though base-units were restricted to fundamental dimensions length, mass,
time etc. This example works but doesn't this concept clash with what is
mentioned in

http://www.boost.org/doc/libs/1_40_0/doc/html/boost_units/Units.html#boost_units.Units.base_units

Thanks,
Manoj


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net