Boost logo

Boost :

From: Matthias Schabel (boost_at_[hidden])
Date: 2008-05-14 11:58:17


> I realize that the Units libary is still a work-in-progress, but I
> thought you might like to know about these failures. Using 1.35.0
> with the latest Units code (SVN rev. 45355) and using GCC 4.1.2, I get
> these failures in test/:
>
> test_limits,
> test_cmath

You will need get boost/math/special_functions from the trunk - Steven
just
checked in some revisions that replaced our ad hoc implementations of
some
of these math functions with those defined in Boost.Math.

> Also, I cannot compile this simple test code. I may very well be
> doing something wrong:
>
> #include <boost/units/systems/si.hpp>
> #include <boost/units/systems/other/foot.hpp>
> #include <boost/units/systems/detail/non_si_unit.hpp>
>
>
> BOOST_UNITS_NON_SI_UNIT(survey, yard_per_sec, yard_per_sec, 0.3048006
> * 3.0, boost::units::SI::velocity, 53);
>
> typedef
> boost::units::quantity<boost::units::survey::yard_per_sec_base_unit,
> double> YardsPerSec;
>
> int main()
> {
> YardsPerSec yps1;
> YardsPerSec yps2;
> yps1 -= yps2;
> }

This is probably because you need to convert the base unit into a unit
by qualifying with unit_type :

typedef
boost
::units
::quantity
<boost::units::survey::yard_per_sec_base_unit::unit_type,double>
YardsPerSec;

We should see if there is a way to at least warn in these cases...

Matthias


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk