Boost logo

Boost :

Subject: Re: [boost] [units] problems
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2013-09-15 21:51:19


On 9/14/2013 5:31 PM, Quoth Robert Ramey:
> I went back and tried to compile the tutorial - and it failed in the same
> circumstance with the same message. I tried this with current release
> branch and version 1.54 . I'm pretty much at loss here. I can't
> believe that I'm the first person to have this problem.

The following code was extracted from something that compiles and is
working with 1.53:

#include <boost/units/absolute.hpp>
#include <boost/units/cmath.hpp>
#include <boost/units/io.hpp>
#include <boost/units/make_scaled_unit.hpp>
#include <boost/units/systems/si/length.hpp>
#include <boost/units/systems/si/prefixes.hpp>
#include <boost/units/systems/si/time.hpp>
#include <boost/units/systems/si/velocity.hpp>
#include <boost/units/quantity.hpp>

namespace app
{

namespace units
{

using boost::units::quantity;
using boost::units::quantity_cast;

using boost::units::si::length;
using boost::units::si::meter;
using boost::units::si::meters;

using boost::units::si::time;
using boost::units::si::second;
using boost::units::si::seconds;

using boost::units::si::velocity;
using boost::units::si::meter_per_second;
using boost::units::si::meters_per_second;

typedef quantity<length> Length;
typedef quantity<time> Time;
typedef quantity<velocity> Velocity;

}

// ...

   void set_speed(units::Velocity speed);

// ...

   conveyor.set_speed(0.5 * units::meters_per_second);

}


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