Closed
Description
struct example {
example(std::string&&) {}
void name(std::string&&) {}
};
pybind11::class_<example>(m, "example")
.def(pybind11::init<std::string&&>()) // this works
.def<void(example::*)(std::string&&)>("name", &example::name) // this doesn't
;
Error message:
/usr/local/include/pybind11/pybind11.h:72:74: error: rvalue reference to type 'basic_string<...>' cannot bind to lvalue of type 'basic_string<...>'
initialize([f](Class *c, Arg... args) -> Return { return (c->*f)(args...); },
Metadata
Metadata
Assignees
Labels
No labels