-
Notifications
You must be signed in to change notification settings - Fork 22
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
PerformAction Event Description #49
Conversation
Signed-off-by: Yadunund <[email protected]>
Signed-off-by: Yadunund <[email protected]>
Signed-off-by: Yadunund <[email protected]>
Signed-off-by: Yadunund <[email protected]>
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.
This looks really great! I just left a few nitpicks, but none of them are blockers.
rmf_task_sequence/include/rmf_task_sequence/events/PerformAction.hpp
Outdated
Show resolved
Hide resolved
rmf_task_sequence/src/rmf_task_sequence/events/PerformAction.cpp
Outdated
Show resolved
Hide resolved
auto PerformAction::Description::use_tool_sink( | ||
bool use_tool) -> Description& | ||
{ | ||
_pimpl->use_tool_sink = std::move(use_tool); |
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.
Not really important, but just a remark: Moving a primitive type like bool
doesn't really do anything special compared to copying it. Either way it will perform a copy.
Moving only matters when one or more fields are heap-allocated objects whose copy operators perform a deep copy, like std::vector
or std::[unordered_]map
. Or objects whose copy operator has side effects, like std::shared_ptr
's copy operation increments a reference count while its move operation doesn't. Or most importantly objects that don't offer a copy operator like std::unique_ptr
.
Using move here doesn't hurt anything, but I thought it would be good to share the above info.
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.
Thanks for the explanation; very helpful 👍🏼
Signed-off-by: Yadunund <[email protected]>
Signed-off-by: Yadunund <[email protected]>
Cherry picked the description introduced here #46