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

Replace std::bind by lambda expression to fix compile issue #3254

Merged
merged 1 commit into from
Jul 26, 2019

Conversation

SunBlack
Copy link
Contributor

No description provided.

@taketwo
Copy link
Member

taketwo commented Jul 20, 2019

What compiler error did you get? I built master (including CUDA apps) just yesterday with GCC7 and got no errors.

Speaking about the lambda, @SergioRAgostinho I think you usually capture this explicitly, right?

@SergioRAgostinho
Copy link
Member

SergioRAgostinho commented Jul 20, 2019

Speaking about the lambda, @SergioRAgostinho I think you usually capture this explicitly, right?

Yes. In my dev environment, this always needs to be explicitly captured.

Edit: Sorry. I overlooked it in my previous suggestion.

@SunBlack
Copy link
Contributor Author

SunBlack commented Jul 20, 2019

What compiler error did you get? I built master (including CUDA apps) just yesterday with GCC7 and got no errors.

See referenced PR:

/media/sf_pcl/cuda/apps/src/kinect_viewer_cuda.cpp:80:9: error: no viable conversion from 'typename _Bind_helper<__is_socketlike<void (KinectViewerCuda::*)(const shared_ptr<Image> &, const shared_ptr<DepthImage> &, float)>::value, void (KinectViewerCuda::*)(const shared_ptr<Image> &, const shared_ptr<DepthImage> &, float), KinectViewerCuda *, const arg<1> &, const arg<2> &, const arg<3> &>::type' (aka '_Bind<void (KinectViewerCuda::*(KinectViewerCuda *, boost::arg<1>, boost::arg<2>, boost::arg<3>))(const boost::shared_ptr<openni_wrapper::Image> &, const boost::shared_ptr<openni_wrapper::DepthImage> &, float)>') to 'std::function<void (const boost::shared_ptr<openni_wrapper::Image> &, const boost::shared_ptr<openni_wrapper::DepthImage> &, float)>'
        f = std::bind (&KinectViewerCuda::cloud_cb_, this, _1, _2, _3);

I believe the issue is, that clang 6 is using boost::arg<1> instead of std::arg<1> for _1 .

Speaking about the lambda, @SergioRAgostinho I think you usually capture this explicitly, right?

Good to know, didn't followed all transitions in last time, so I didn't knew this convention.

General question: Why #3249 changed boost::bind to std::bind during there are a lot of PRs with Prefer lambdas over binds? //Edit: Didn't read description in #3249, just read the title. Shame on me ;)

@SergioRAgostinho
Copy link
Member

I believe the issue is, that clang 6 is using boost::arg<1> instead of std::arg<1> for _1 .

That would make sense. There's no using clause exposing the std::placeholders namespace.

@taketwo taketwo merged commit bc8b5f0 into PointCloudLibrary:master Jul 26, 2019
@SunBlack SunBlack deleted the cuda_bind_fix branch July 30, 2019 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants