Replies: 2 comments 2 replies
-
Hi @hwiesmann, Thank you for your interest in the library. Serializing the underlying quantity value should not be a problem. Just call If you want to serialize a unit or a quantity type, please note that the majority of such libraries on the market require this information to be known at compile-time. This means that you can't dynamically create any quantity with any unit from the stream. So, there is probably no sense in serializing a unit and a quantity type at all. If this was your use case, then you might be interested in #483. Please share your use case there so we will have more motivation for this feature if we try to implement it and then possibly "sell" to the ISO C++ Committee. |
Beta Was this translation helpful? Give feedback.
-
Hi,
Sorry, I was a bit confused. Just forget my last message.
… Am 27.12.2024 um 13:09 schrieb Mateusz Pusz ***@***.***>:
I am afraid that I do not follow. A unit is a part of a type. If you know the type you also know a unit. In such a case the only thing you need to serialize is the numerical value of the quantity.
—
Reply to this email directly, view it on GitHub <#661 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAD6V3GAONNWK332REBWX632HU7QXAVCNFSM6AAAAABUF5RTU6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNRXG4YTCNQ>.
You are receiving this because you were mentioned.
|
Beta Was this translation helpful? Give feedback.
-
What is the recommended way to do quantity serialization?
I have to admit that I am currently not deeply familiar with the library as I am currently evaluating which "units" library to use. One requirement is to easily being able to serialize the quantity using cereal, protobuf or others.
Best regards,
Hardy
Beta Was this translation helpful? Give feedback.
All reactions