Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat!: add number concepts #492
base: master
Are you sure you want to change the base?
feat!: add number concepts #492
Changes from 2 commits
bab7acf
2b64931
3661010
8e5d84d
fa7c0b3
c5ac0e0
008175d
a30d972
b6027be
4a52e64
5117eeb
582cbba
e44a677
2cb7b2d
3ce672d
48b931f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this version the minimum one required to make it work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but I'm not sure about the dependency itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If possible, I would like to keep the required version as low as possible to not force the users to install the latest CMake with no good reason.
Alternatively, we can install the required version of CMake with Conan but I would prefer to save it as a last resort option (i.e. to support C++ modules).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not consistent with how modulo operation on quantities works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we use https://eel.is/c++draft/expr.mul#4 instead of redefining the operation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you're referring to the cases for which the modulo of
quantity
was made ill-formed.This term modulo is used by a
concept
which already checks for its validity.And when it is valid, it better behaves like this.
I did consider that.
I saw value in phrasing it like division.
That's certainly correct,
and doesn't run the risk of a bad specification due to saying something like
"behaves like
%
for integral operands".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://mpusz.github.io/mp-units/2.0/users_guide/framework_basics/quantity_arithmetics/#modulo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you.
I think it's well defined as is.
q % r
performs the modulo in the set that is the common type of the arguments,so the quotient-remainder theorem holds.
It does seem surprising because
q
andr
are mapped to the common type before the modulo,and so a and b in the definition of modulo correspond to the value of the converted arguments.
So the quotient-remainder theorem doesn't work on the actual input arguments in code.