Skip to content
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

[RFE] Support for mp-units in CGAL #8270

Open
lrineau opened this issue Jun 10, 2024 · 1 comment
Open

[RFE] Support for mp-units in CGAL #8270

lrineau opened this issue Jun 10, 2024 · 1 comment

Comments

@lrineau
Copy link
Member

lrineau commented Jun 10, 2024

Previous discussion, in a PR

However, if I understand correctly, you already use fundamental unsafe types in your interfaces. If so, you can easily conditionally add additional type-safe overloads to them.

In case you already have some Simple strong-type wrappers for units, mp-units provides powerful conversation traits that give us full control of how we can interact with such interfaces.

Originally posted by @mpusz in #8262 (comment)

Proposal for enhancement

In CGAL::Epick, we could try to support mp-units's abstraction for the affine space (in our case that would be the 2D and 3D Euclidean spaces).

That would be a way to verify if CGAL is correct about units.

If the CGAL kernel testsuite passes with a variant of Epick using mp-units, that would be a big achievement.

@lrineau lrineau changed the title I am not aware of such a project. [RFE] Support for mp-units in CGAL Jun 10, 2024
@chiphogg
Copy link

mp-units is an excellent library. However, I understand from that issue that in order to use it, you would need to add macros to disable that support for C++17 users, which seems undesirable.

There are other high-quality modern C++ units libraries that have a less stringent minimum version requirement. In particular, many are compatible with C++14, and more still with C++17. Here's a GitHub query giving a list of C++ units libraries.

I've done a detailed feature comparison of the top libraries by GitHub stars, plus Boost Units. (Full disclosure: I'm the author of one of these libraries, and the comparison is hosted on its documentation website.)

Before picking a library to use, it might be good to compare the feature diff between mp-units and the best C++17-compatible alternative. Then, decide whether those extra features for the C++20 users are worth completely excluding the C++17 users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants