-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is mp-units targeting freestanding implementations #556
Comments
Sure, freestanding is our target as stated here https://wg21.link/p3045#low-standardization-cost and as I explicitly said several times before (#406, #7). |
OK. Apologies. I have not followed mp-units for a while. That is reassuring, but slightly vague. Ideally I would hope for the full functionality but without major IO overhead , though in practise some diagnostic output in a simple format is always going to be required. |
Initially, we tried to isolate IO as much as possible (separate CMake targets, separate C++ modules, etc.), but it didn't scale. I consulted the best freestanding experts in the ISO Committee on how to proceed, and they said to do the same as a C++ standard library does. If needed, we will provide preprocessor logic to limit functionality for freestanding if such is requested by the users.
Sure, this is why we expose the following functions that should help build a custom mechanism without the need to include streams or formatting facilities: mp-units/src/core/include/mp-units/unit.h Lines 840 to 841 in 792bd2c
mp-units/src/core/include/mp-units/unit.h Lines 860 to 861 in 792bd2c
|
I will try to get back to testing mp-units. In embedded environment absolute limit is the amount of rom available on the microcontroller. The smaller the footprint of the library, the bigger the range of microcontroller a library will run on. nyway don't underestimate the microcontroller side. It is a large user base and could find mp-units very useful, but don't make anything like as much noise as others ;) |
This would be great @kwikius! As of now we don't use any conditional compilation for freestanding. We need to decide if we should introduce custom flags or use those used by the compiler vendors. But we need some for sure and we need some testing on embedded environments as well. |
More info on text output can be found in https://mpusz.github.io/mp-units/2.2/users_guide/framework_basics/text_output/#derived-unit-symbols-generation |
As title . I work mainly on embedded systems, which are typically freestanding . Is mp-units going to require a hosted implementation?
The text was updated successfully, but these errors were encountered: