C++* < C++20 #273
Replies: 3 comments 3 replies
-
This library is planned to become a part of the C++26 standard. This is why it has to benefit from the latest standards to provide the best possible interfaces for the future. I know that it limits the user base as of now but I hope more and more people will be able to use it in the upcoming months. As of now all of the major compilers already provide support for the library (https://mpusz.github.io/units/usage.html) so it should be possible to try it in nearly every environment.
|
Beta Was this translation helpful? Give feedback.
-
BTW, based on your experience from implementing and using a proprietary library, it would be great if you could share feedback so we can account for your requirements and have a better product in the future's standard. |
Beta Was this translation helpful? Give feedback.
-
For users who need a good units library but can't support C++20, it's clear that mp-units will never be the answer (at least, not until they move to C++20). OK, so what is the answer for these users? Here's a GitHub search query for If you need guidance picking from this list, and you don't mind an obviously biased source 😁, I would recommend aurora-opensource/au, assuming you can support C++14. (My bias is that I'm the lead author and maintainer.) Au is actively maintained, widely accessible, and almost trivially easy to install in any build system. We have extensive real-world production experience; fluent, composable APIs; an adaptive "overflow safety surface" for unit conversions with integral types; and fully unit-safe interfaces. We're the only units library I know of which delivers the kind of concise compiler errors which mp-units pioneered, outside of mp-units itself. And if you already have a units library --- or, you want to migrate away from Au later --- we're the easiest units library to migrate to or from. Typically, I wouldn't presume to advertise my project on the repo of what is technically a competing project. 🙂 However, for this group of users, there's no competition; these are folks who simply can't use mp-units. What's more, my main answer gives an objective list of alternatives (so users can judge for themselves), and I've also stated my bias clearly and up front. I hope you find it helpful! |
Beta Was this translation helpful? Give feedback.
-
Big kudos. I deal with physical systems. I cannot overemphasize the importance of a proper use of units. I regularly come across the source codes that were written with ignorance of the unit compatibility, causing wreck-havoc only far later. I myself wrote proprietary solutions of this problem. It is immeasurably beneficial to have a standard way of dealing with this mater.
While I am a strong proponent of this work, I humbly ask you to consider that this work is too critical to be applied to C++20 only. The vast majority of code is written in C++11 and C++14. Do you see a path to have a support incumbent standards of C++?
Respectfully,
Beta Was this translation helpful? Give feedback.
All reactions