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

Can't bind functor returned by std::bind #88

Open
YukinoHayakawa opened this issue Aug 30, 2018 · 1 comment
Open

Can't bind functor returned by std::bind #88

YukinoHayakawa opened this issue Aug 30, 2018 · 1 comment

Comments

@YukinoHayakawa
Copy link

I have a function like:

Scene * Foo::createScene(
    const std::string &name,
    std::uint32_t width,
    std::uint32_t height)

Since I want it to be used like a static in lua, I bind it using

    state["createScene"].setFunction(std::bind(
        &Foo::createScene, this, _1, _2, _3));

But this does not work (at least in VS17, and I'm using C++ 17).
Looks like because decltype(&T::operator()) in has_operator_fn failed for some reason.
Any ideas?

@YukinoHayakawa
Copy link
Author

Seems to be caused by the const/nonconst overloads of operator() of the object returned by std::bind.

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

No branches or pull requests

1 participant