-
Notifications
You must be signed in to change notification settings - Fork 282
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
Use std::is_signed and std::enable_if #2395
Conversation
549c34f
to
2626e2a
Compare
2626e2a
to
320fd2f
Compare
unitTests/test_safe_op.cpp
Outdated
@@ -73,7 +73,7 @@ const T AdditionTestValues<T, typename si::enable_if<si::is_signed<T>::VALUE>::t | |||
|
|||
template <typename T> | |||
const bool | |||
AdditionTestValues<T, typename si::enable_if<si::is_signed<T>::VALUE>::type>::overflow[case_count][case_count] = { | |||
AdditionTestValues<T, typename std::enable_if<std::is_signed<T>::VALUE>::type>::overflow[case_count][case_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.
is_signed_t
|
@neheb: thanks, I added your suggestion in commit 2. |
Codecov Report
@@ Coverage Diff @@
## main #2395 +/- ##
=======================================
Coverage 64.28% 64.28%
=======================================
Files 119 119
Lines 21136 21136
Branches 10428 10428
=======================================
Hits 13587 13587
Misses 5400 5400
Partials 2149 2149
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
I’ll note this works because exiv2 is c++17. This shouldn’t be done for public facing headers where C++11 is requested. |
This PR now uses these features:
The C++14, C++17 features are only used in |
it looks like safe_op.hpp is a private header as well. It could use the same treatment. |
I also noticed test_slice.cpp has several comments indicating a bunch of code can go away. Can you take a look? |
Now that we're using C++11, we can use
std::is_signed
andstd::enable_if
.