You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
structexample {
example(std::string&&) {}
voidname(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...); },