Closed rothmichaels closed 11 months ago
@rothmichaels I think that I raced with @JohelEGP review while merging this PR. Could you please still consider adding the proposed changes?
@mpusz sure thing. I'll make some updates tonight when I get back to my hotel.
At least the storage tank example comes from https://github.com/mpusz/mp-units. If that's the case for all others, I guess @mpusz would ask you for a PR there to ensure the paper's version stays up-to-date.
Do you want me to open a PR for mp-units with this new example?
I think it is a great example to have in mp-units as well :-) Before submitting the PR, please check out my changes to your sample in the paper and Compiler Explorer. BTW, I am still thinking if you should use a strong dimension or dimensionless quantities for your case. I checked that the IEC 80000 uses the latter for bits:
This is needed for storage capacity to be able to be expressed both in bits and in a unit one
:
In case you would like to prevent the usage of one
, then a strong dimension is recommended.
I thought it might be useful to have a motivation and example about the need for library users to be able to define domain specific quantities and units with all the functionality provided by library quantitites and units.
I wrote this on the plane after CppCon when I was a bit tired, so maybe it needs an editing pass for clarity.