| 1 | // Demonstration of cmath helper issue
|
|---|
| 2 |
|
|---|
| 3 | #include <iostream>
|
|---|
| 4 |
|
|---|
| 5 | #include <boost/units/systems/si.hpp>
|
|---|
| 6 | #include <boost/units/io.hpp>
|
|---|
| 7 | #include <boost/units/cmath.hpp>
|
|---|
| 8 |
|
|---|
| 9 | int main() {
|
|---|
| 10 | using namespace boost::units;
|
|---|
| 11 |
|
|---|
| 12 | boost::units::quantity<si::wavenumber, float> x, y;
|
|---|
| 13 |
|
|---|
| 14 | // This assignment compiles:
|
|---|
| 15 | boost::units::quantity<si::wavenumber, float> foo;
|
|---|
| 16 | foo = sqrt(x*x + y*y);
|
|---|
| 17 |
|
|---|
| 18 | // The identical expression fails as an initialization:
|
|---|
| 19 | boost::units::quantity<si::wavenumber, float> bar = sqrt(x*x + y*y);
|
|---|
| 20 |
|
|---|
| 21 | }
|
|---|