
Can you include your atomic.hpp? Matthias
From: alfC <alfredo.correa@gmail.com> Date: July 6, 2011 1:16:11 PM PDT To: boost-users@lists.boost.org Subject: [Boost-users] [units] combined systems and prefixes and output Reply-To: boost-users@lists.boost.org
Hi,
After some effort I managed to add a new system to boost units (namely "atomic"). The system works so far until I start using si prefixes in combination and printing
int main(){ clog << 4.*atomic::hbar << endl; // output: 4 hbar clog << 4.*(si::femto*si::second) << endl; // output: 4 fs clog << 4.*(atomic::hbar/si::second) << endl; // output: 4 s^-1 hbar auto a = atomic::hbar/(si::femto*si::second); // ok clog << a << endl; // output: P(s^-1 hbar) auto b = 4.*atomic::hbar/(si::femto*si::second); // ok
clog << b << endl; // error!!!! why?
return 0; }
As you see all lines work as expected except for the last line. Is there a workaround? do I need to define prefixes specific for the other system of units?
The error message boils down to:
usr/include/boost/units/detail/linear_algebra.hpp:197:48: error: no type named ‘item’ in ‘struct boost::units::list<boost::units::list<boost::units::static_rational<0l, 1l>, boost::units::list<boost::units::static_rational<1l>, boost::units::dimensionless_type> >, boost::units::dimensionless_type>::next’
also I defined hbar as
struct reduced_planck_constant_base_unit : base_unit< reduced_planck_constant_base_unit, action_dimension, 3
{ static string name(){return ("reduced Planck constant");} static string symbol() {return ("hbar");} }; static const action hbar;
Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users