Comments (9)
What does "self contained" mean?
Like a repo which has a 1 line main()
and which submodule includes mp-units@trunk
and its dependencies?
It's sort of just a cut down version of trunk, really? ie trunk minus tests and other examples?
Or do they mean, actually cut down the code to a "minimal example" which produces the same symptom? Something less than 100 lines of code in a single file.
The latter would make more sense to me.
from mp-units.
from mp-units.
Taken some baby steps and reduced the above example to the below:
- it's not about
int
casting - it's not about quantity casting either
- a single calculation won't do it, you need 2 calculations using exactly the same units. The second one breaks.
- a single dimension/unit won't do it, you need a combination in each calculation
Wild guess: Compiler does the "eval" of the units string for the display of the first value. And thinks it's "cached / already eval'd" for the second one...except it isn't.
[thoughtful face]
#include <units/physical/si/velocity.h>
#include <iostream>
using namespace units;
int main()
{
using namespace si::literals;
Velocity auto v1 = 100km/2h;
Velocity auto v4 = 220.1km/3h;
std::cout << v1 << '\n'; // 50 km/h
std::cout << v4 << '\n'; // 73.3667 (missing units)
}
from mp-units.
What does "self contained" mean?
It means that all the sample is in a single file without any external headers and ideally no C++ headers.
from mp-units.
If you moved this to "in progress" does that mean you are working on it?
I don't want to double up.
It "might" pop-out quickly, but this could also be a black hole, I fear?
from mp-units.
No, I actually thought that you work on it ;-)
from mp-units.
OK, that's fine. I will let you know how I get on. As I said, I might get stuck...
from mp-units.
It seems that the problem was caused by gcc and was fixed on master: https://godbolt.org/z/pJ7fC_.
from mp-units.
Phew..I was dreading this one!
from mp-units.
Related Issues (20)
- Should we allow deriving from system entities? HOT 2
- No 2.1.0 in Conan center HOT 3
- ice_point definition is (very very slightly) incorrect
- Do we really need ASCII-only text output? HOT 13
- Text input support
- formatting/printing vector of quantities results in compile time error HOT 3
- Bazel build system support HOT 3
- Should conversions from the raw numerical value to a dimensionless quantity with a unit one be allowed? HOT 26
- Is mp-units targeting freestanding implementations HOT 6
- Provide `wchar_t` support for text output
- Effectively global unit names like 'm' are problematic HOT 35
- compilation time and how to improve it HOT 17
- Can't compile with localization disabled HOT 1
- Can't compile with exceptions disabled HOT 1
- Linker error with base units for "numerical_value_in()" HOT 4
- Clarify concepts and casting rules of quantity kinds and types HOT 6
- I miss `value_cast<ToQ>` and potentially `value_cast<ToQP>` HOT 11
- Version bump HOT 7
- Allow configuring GSL library use HOT 2
- Configuration not propagated to compiler defines HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mp-units.