Skip to content

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

@YukinoHayakawa

Description

@YukinoHayakawa

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions