File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -880,10 +880,11 @@ template <typename type> class type_caster_base : public type_caster_generic {
880
880
nullptr , nullptr , holder);
881
881
}
882
882
883
- template <typename T> using cast_op_type = detail::cast_op_type <T>;
883
+ template <typename T> using cast_op_type = detail::movable_cast_op_type <T>;
884
884
885
885
operator itype*() { return (type *) value; }
886
886
operator itype&() { if (!value) throw reference_cast_error (); return *((itype *) value); }
887
+ operator itype&&() && { if (!value) throw reference_cast_error (); return std::move (*((itype *) value)); }
887
888
888
889
protected:
889
890
using Constructor = void *(*)(const void *);
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ PYBIND11_MODULE(test_move_arg, m) {
18
18
std::cout << " access " << item << " \n " ;
19
19
}, py::call_guard<py::scoped_ostream_redirect>());
20
20
21
- #if 0 // rvalue arguments fail during compilation
21
+ #if 1 // works for this example now, but failing for other unit tests
22
22
m.def (" consume" , [](Item&& item) {
23
23
std::cout << " consume " << item << " \n " ;
24
24
Item sink (std::move (item));
You can’t perform that action at this time.
0 commit comments