Replies: 1 comment
-
Hi @khasrusn! The majority of C++ units libraries are about compile-time type safety. This requires strong types, as you stated. This, however, also means that you can't dynamically create a quantity at runtime without knowing its type upfront. Said that we have two issues that might help you when/if they are resolved:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Thank you for the project.
I have a need to write a function to convert different units of measurement of the following type:
When trying to write such a converter I encounter problems with strong typing of quantities and I lack the experience to get around them. I understand that I can write a function to convert using if-else if blocks, but what if my project requires converting a large number of different units of measurement? Please tell me if it is possible to solve my problem using your library or should I look for other libraries?
Beta Was this translation helpful? Give feedback.
All reactions