Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Units] Trouble with I/O and specific scaled units
From: Michael J Iatauro (Michael.J.Iatauro_at_[hidden])
Date: 2011-10-20 21:24:41


I have the following declarations (reduced from a much larger problem):

typedef make_system<si::second_base_unit>::type system;
typedef unit<time_dimension, system> second;
BOOST_UNITS_STATIC_CONSTANT(seconds, second);

typedef make_scaled_unit<second, scale<60, static_rational<1> > >::type
minute;
BOOST_UNITS_STATIC_CONSTANT(minutes, minute);

Unfortunately, if I try this:

quantity<minute, double> t = 33.3 * minutes;
std::cout << t << std::endl;

I get, ultimately, a pair of compile errors:

io.hpp:392: error: ‘name’ is not a member of
‘boost::units::scale_list_dim<boost::units::scale<60l,
boost::units::static_rational<1l, 1l> > >’
io.hpp:326: error: ‘symbol’ is not a member of
‘boost::units::scale_list_dim<boost::units::scale<60l,
boost::units::static_rational<1l, 1l> > >’

I tried adding

std::string name_string(const minute&) {
   return "min";
}

std::string symbol_string(const minute&) {
   return "min";
}

but that didn't change anything. Interestingly, if I change the scale
from 60 to 10, it compiles and runs fine. What am I missing?

Thanks!

~MJI

------------------
Michael J. Iatauro
Software Engineer
Dell | Services, Federal Government

NASA Ames Research Center
Office: 650-604-0662
Mail stop: 269-2
P.O. Box 1
Moffett Field, CA 94035-0001
www.dell.com/perotsystems


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