Closed wouterz closed 8 months ago
Thanks for reporting! This issue is expected, as we loosened the restrictions on quantity creation with #496 only after the 2.0 was released. It will be supported from 2.1. We hope to release it soon, but we need to finish some changes first.
This example should be working fine on the Compiler Explorer when the mainline version is selected. Also, you can try https://mpusz.github.io/mp-units/2.1/getting_started/installation_and_usage/#conan-cmake-live-at-head to get the latest stable version through Conan.
Thanks for the quick response!
You are welcome! 😃
Please let us know if this resolves your issue and if we can close it now.
I wont switch to the live head version for stability reasons, but ill close it and try to make it work!
I've been trying implement this library into a project, but I've run into an issue that I've narrowed down to one of the examples (hello_units) also not compiling as should. For a simplified version
Were using the library with conan; conanfile.txt
profile
hello_units_mini.cpp
All other lines in this example compile and run. The code is compiled with CMake linking
mp-units::mp-units
.Here are the errors (click for full log):
``` [build] /home/wslouter/Projects/test/mp_units/src/hello_units.cpp:20:38: error: no match for ‘operator/’ (operand types are ‘mp_units::quantity(), int>’ and ‘const mp_units::si::second’)
[build] 20 | constexpr quantity v1 = (110 * km) / s;
[build] | ~~~~~~~~~~ ^ ~
[build] | | |
[build] | | const mp_units::si::second
[build] | mp_units::quantity(), int>
```
``` [build] /home/wslouter/Projects/test/mp_units/src/hello_units.cpp:20:38: error: no match for ‘operator/’ (operand types are ‘mp_units::quantityWhich dont really make sense to me in
unit(_symbols).h
and in
space_and_time.h
Im also fine with by multiplying a quantity by 1, but as this breaks an example I wanted to report this issue. Also willing to contribute a fix if you can point me in the right direction to fix it.