Boost logo

Boost Users :

Subject: [Boost-users] [units] newbie : plane_angle
From: Damien R (damien.rg_at_[hidden])
Date: 2009-10-11 16:14:50


Hi,
I just discover boost::units and I want to know how it works in this case :
quantity<si::plane_angle> angle(45 * degree);

When the constructor is called, is the argument converted in radian or
not ?

Moreover, it is possible to have :
quantity<??::plane_angle> angle(45 * degree);
angle += pi / 4 * radian;
cout << angle << endl;
cout << quantity<degree::plane_angle>(angle) << endl;
cout << quantity<radian::plane_angle>(angle) << endl;
cout << angle.value<degree>() << endl;
cout << angle.value<radian>() << endl;

output :
45 deg + pi / 4 rad
90 deg
pi / 2 rad
90
1.57079632679

Thanks.

--
Damien R

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