Boost logo

Boost :

From: vladimir josef sykora (vladimir.sykora_at_[hidden])
Date: 2003-02-26 10:32:12

Hello Alexander,
The issue regarding physical unit types has been raised a couple of times on
this newsgroup; however no agreement has been reached so far concerning the
functionalities such a library should provide, nor on its design.
I developed a small library for that purpose (new version under: )
which provides compile-time safety for physical units and functionality for
run-time conversions, though it has no proper documentation (its on the
way.) This library so far has covered my needs. Some examples on how to
define units' types with the library:

type_list_canonizer<boost::mpl::vector< dimension_type_generator<
meterPolicy<>,1>::type > >::type meter_typelist;
type_list_canonizer<boost::mpl::vector< dimension_type_generator<
meterPolicy<kilo>,1>::type > >::type kilometer_typelist;
type_list_canonizer<boost::mpl::vector< dimension_type_generator<
my_unit<>,1>::type > >::type self_defined_unit_typelist;

unit<double, kilometer_typelist> km(1.0);
unit<float, meter_typelist> m(km);

std::cout << m << '\t';

// output: 1000 m


vladimir josef sykora
morphochem AG
gmunder str. 37-37a
81379 muenchen
tel. ++49-89-78005-0
fax  ++49-89-78005-555
"Alexander Dz" <alexanderdz_at_[hidden]> wrote in message
> Hi All,
> I'm participating in pretty complicated scientific
> project. I'm thinking to deploy a library which helps
> me to deal with measurement units. As far as I see,
> SIunits from Walter E. Brown is the most advanced one.
> Do anybody has experience with SIunits? Where to
> download it today? Do other units libraries from
> alive?
> Thanks in advance,
> Alexander Dzjuba
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> _______________________________________________
> Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at