Skip to content
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

add missing unit symbols for ohm #574

Merged
merged 2 commits into from
May 15, 2024

Conversation

burnpanck
Copy link
Contributor

@burnpanck burnpanck commented May 11, 2024

There is a question here if ohm is actually a unit symbol in addition to being a unit name, but having kohm in the library is definitely helpful. Of course with unicode symbol names, we would want to use Ω instead (or in addition).

inline constexpr auto mohm = milli<si::ohm>;
inline constexpr auto cohm = centi<si::ohm>;
inline constexpr auto dohm = deci<si::ohm>;
inline constexpr auto ohm = si::ohm;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not add those exactly because of that. If someone does a using-directive on both si and si::unit_symbols, then ohm will be ambiguous. I still am not sure it that is an issue or not. @JohelEGP, do you have an opinion here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. Actually, I'm doing that myself:

namespace some_relevant_namespace_for_my_code {

namespace u {
using namespace mp_units;
using namespace mp_units::si;
using namespace mp_units::isq;
using namespace mp_units::si::unit_symbols;
}

}

Maybe I never use plain ohm anywhere? I would definitely want to have some kind of prefixed ohm units somewhere - maybe we keep the rest and skip the plain ohm? Altentatively, the v1 "references" kR etc... did not have this isssue, but are obvisously somewhat non-standard.

@mpusz mpusz requested a review from JohelEGP May 11, 2024 17:37
Co-authored-by: Mateusz Pusz <mateusz.pusz@gmail.com>
Copy link
Owner

@mpusz mpusz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@mpusz mpusz marked this pull request as ready for review May 15, 2024 06:47
@mpusz mpusz merged commit 3ccdcdd into mpusz:master May 15, 2024
41 of 77 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants