-
Notifications
You must be signed in to change notification settings - Fork 26
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
Cmake namespace #136
Cmake namespace #136
Conversation
Co-authored-by: Philip Top <top1@llnl.gov> Co-authored-by: HELICS-bot <HELICS-bot@users.noreply.github.com>
…cmake_namespace
Co-authored-by: Philip Top <top1@llnl.gov> Co-authored-by: HELICS-bot <HELICS-bot@users.noreply.github.com>
Codecov Report
@@ Coverage Diff @@
## master #136 +/- ##
=======================================
Coverage 99.43% 99.43%
=======================================
Files 6 6
Lines 4780 4790 +10
=======================================
+ Hits 4753 4763 +10
Misses 27 27 |
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.
As far as I can see, no changes to the unit tests were made, i.e., test cannot be built unless UNITS_NAMESPACE=units
. Intentional?
If not, SimonHeybrock@0d9d7ae has the required modifications.
units/units_decl.hpp
Outdated
constexpr int32_t mole{2}; | ||
constexpr int32_t radian{3}; | ||
constexpr int32_t currency{2}; | ||
constexpr int32_t count{2}; |
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.
👍 more readable than what I had.
Co-authored-by: Philip Top <top1@llnl.gov> Co-authored-by: HELICS-bot <HELICS-bot@users.noreply.github.com>
units/units_decl.hpp
Outdated
meter_(maxNeg(bitwidth::meter)), second_(maxNeg(bitwidth::second)), | ||
kilogram_(maxNeg(bitwidth::kilogram)), | ||
ampere_(maxNeg(bitwidth::ampere)), | ||
candela_(maxNeg(bitwidth::candela)), | ||
kelvin_(maxNeg(bitwidth::kelvin)), mole_(maxNeg(bitwidth::mole)), | ||
radians_(maxNeg(bitwidth::radian)), | ||
currency_(maxNeg(bitwidth::currency)), | ||
count_(maxNeg(bitwidth::count)), |
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.
Does this mean we should exclude this here:
Line 18 in 0df7071
static constexpr int32_t min = -(static_cast<int32_t>(1U << Bits) / 2); |
Add a means to change the namespace the units library lives under.
See Issue #110
It can be set using CMAKE with
-DUNITS_NAMESPACE=<desired namespace>
or in the code
if nothing is done the namespace defaults to
units