Boost logo

Boost Users :

Subject: [Boost-users] [units] extend system: temperature unit for cgs system
From: alfC (alfredo.correa_at_[hidden])
Date: 2011-02-18 03:30:55


Hi,
 in a recent project I am working in cgs units because the people
involved is used to that system.

I was surprised to find that the cgs unit system defined in
boost.units doesn't have a temperature unit.

Therefore this program compiles and gives a strange result:

#include<boost/units/systems/cgs/io.hpp>
#include<boost/units/physical_dimensions/temperature.hpp>
#include<iostream>
using namespace boost::units;
int main(){
  std::clog << quantity<unit<temperature_dimension, cgs::system>
>::from_value(4.) << std::endl;
  return 0;
}

prints "4 dimensionless".

The fact that there is no temeprature unit in cgs system may be by
design, although I am pretty sure that if any "kelvin" is the unit of
temperature in cgs.

But independly of that I would like to have a cgs-system with kelvin
as unit of temperature.

How can I do that without having to create a whole new system of
derived units almost equal to cgs and without modifying the boost
sources?

Is there a mechanism to extend (give a new dimension) to an existing
system?

Thank you,
Alfredo


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