Skip to content
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

Merged

Conversation

SergioRAgostinho
Copy link
Member

No description provided.

@SergioRAgostinho SergioRAgostinho added this to the pcl-1.10.0 milestone Jun 20, 2019
@taketwo taketwo added the needs: more work Specify why not closed/merged yet label Jun 21, 2019
@SergioRAgostinho SergioRAgostinho added needs: code review Specify why not closed/merged yet and removed needs: more work Specify why not closed/merged yet labels Jun 23, 2019
@@ -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); };
Copy link
Member

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 :)

Copy link
Member Author

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.

@@ -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); };
Copy link
Member

@taketwo taketwo Jun 23, 2019

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.

@taketwo taketwo removed the needs: code review Specify why not closed/merged yet label Jun 23, 2019
@SergioRAgostinho SergioRAgostinho merged commit 861839f into PointCloudLibrary:master Jun 23, 2019
@SergioRAgostinho SergioRAgostinho deleted the bind-tools branch June 24, 2019 08:27
@taketwo taketwo changed the title [tools] Prefer lambdas over binds. Prefer lambdas over binds Jan 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants