-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Prefer lambdas over binds #3178
Prefer lambdas over binds #3178
Conversation
dfb50d9
to
12f70e8
Compare
tools/oni2pcd.cpp
Outdated
@@ -83,7 +83,7 @@ main (int argc, char **argv) | |||
} | |||
|
|||
pcl::ONIGrabber* grabber = new pcl::ONIGrabber (argv[1], false, false); | |||
std::function<void (const CloudConstPtr&) > f = boost::bind (&cloud_cb, _1); | |||
std::function<void (const CloudConstPtr&) > f = [=] (const CloudConstPtr& cloud) { cloud_cb (cloud); }; |
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.
Don't need to capture here. But does not really matter :)
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.
Then I'll change it, don't merge yet. I wasn't sure the function could be trivially captured inside the closure.
tools/davidsdk_viewer.cpp
Outdated
@@ -93,8 +93,7 @@ main (int argc, | |||
//davidsdk_ptr->setFileFormatToPLY(); | |||
std::cout << "Using " << davidsdk_ptr->getFileFormat () << " file format" << std::endl; | |||
|
|||
std::function<void | |||
(const PointCloudXYZ::Ptr&)> f = boost::bind (&grabberCallback, _1); | |||
std::function<void (const PointCloudXYZ::Ptr&)> f = [=] (const PointCloudXYZ::Ptr& cloud) { grabberCallback (cloud); }; |
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.
Also here and in ensenso_viewer
.
No description provided.