-
Notifications
You must be signed in to change notification settings - Fork 613
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
Changed SysID methods to allow logging in custom units #7172
base: main
Are you sure you want to change the base?
Conversation
/format |
* The value is recorded in volts by default; | ||
* to change this, specify your target unit as a generic bound. | ||
* |
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.
* The value is recorded in volts by default; | |
* to change this, specify your target unit as a generic bound. | |
* | |
* @tparam U The unit to log in. Defaults to volts. |
Specifying a target unit as a generic bound doesn't make sense- First, generic bound is a Java term, while in C++ the closest equivalent would be constraint. Second, a generic bound would be specified by the method, not something specified at the call site. Also, I think we require documentation for template parameters anyways, so there isn't as much of a need for a separate description.
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 instead of using a generic it makes more sense to just change the unit in the function signature eg for lengths units::length_unit auto
which should alllow passing in any length
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.
Maybe? Remember that the goal isn't to be able to pass in any type (which could be done already via implicit conversions), it's to output in any type. Logging in whatever unit is passed in is possible, but I'm not sure if that'd necessarily be what users expect.
Resolves #6285.