Код: Выделить всё
struct Foo {
int &value() & {
return v;
};
int v;
};
Код: Выделить всё
nb::class_(m, "Foo").def("value", static_cast(&Foo::value));
Код: Выделить всё
...third_party/nanobind/include/nanobind/nb_class.h:567:28: error: no matching
function for call to 'cpp_function_def(int& (Foo::*)() &, nanobind::scope,
nanobind::name, nanobind::is_method)'
567 | cpp_function_def((detail::forward_t) f, scope(*this),
| ~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
568 | name(name_), is_method(), extra...);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Подробнее здесь: https://stackoverflow.com/questions/792 ... h-nanobind
Мобильная версия