-
Notifications
You must be signed in to change notification settings - Fork 177
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
Fix Result constructor #309
Fix Result constructor #309
Conversation
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.
Other than the default
-> delete
fixes, I'm not sure I understand what is being 'fixed' here.
What triggers this are |
Yeah sure, but it seems to me like this is behaving as expected. If you don't have the explicit move there, you get a copy. Just switching to the explicit constructor should do the trick I believe. I think this is a case where the compiler warning is simply wrong, the move is not redundant at all. |
Result(Result<T, E>&& other) : m_var(std::move(other.m_var)){}; | ||
Result(Result<T, E>&&) = default; |
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.
So, I explicitly changed this from default
to the explicit implementation. I don't quite remember the reason here anymore however. I vaguely remember this had to do with one of the clang builds.
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.
Same for the move assignment, btw.
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 thought that the problem with |
Yeah, if we get this warning, then we have to use the explicit constructors. |
Codecov Report
@@ Coverage Diff @@
## master #309 +/- ##
==========================================
+ Coverage 48.32% 48.33% +0.01%
==========================================
Files 323 323
Lines 16370 16370
Branches 7606 7604 -2
==========================================
+ Hits 7911 7913 +2
Misses 3173 3173
+ Partials 5286 5284 -2
Continue to review full report at Codecov.
|
45720d6
to
d118b03
Compare
@paulgessinger I reduced the scope of this PR. Only the minimal changes to fix the errors in #267 are retained. |
@paulgessinger I would suggest that we merge this in without waiting for the fixed LCG CI builds. |
Ensure correct rvalue reference forwarding and use
default
implementations where possible. Update theRiddersPropagator
to use explicit return types. This fix some remaining compiler warning for #267.