@@ -21,6 +21,7 @@ class ExampleMandA {
2121 ExampleMandA () { print_default_created (this ); }
2222 ExampleMandA (int value) : value(value) { print_created (this , value); }
2323 ExampleMandA (const ExampleMandA &e) : value(e.value) { print_copy_created (this ); }
24+ ExampleMandA (std::string&&) {}
2425 ExampleMandA (ExampleMandA &&e) : value(e.value) { print_move_created (this ); }
2526 ~ExampleMandA () { print_destroyed (this ); }
2627
@@ -43,6 +44,8 @@ class ExampleMandA {
4344 void add9 (int *other) { value += *other; } // passing by pointer
4445 void add10 (const int *other) { value += *other; } // passing by const pointer
4546
47+ void consume_str (std::string&&) {}
48+
4649 ExampleMandA self1 () { return *this ; } // return by value
4750 ExampleMandA &self2 () { return *this ; } // return by reference
4851 const ExampleMandA &self3 () { return *this ; } // return by const reference
@@ -150,6 +153,7 @@ TEST_SUBMODULE(methods_and_attributes, m) {
150153 py::class_<ExampleMandA> emna (m, " ExampleMandA" );
151154 emna.def (py::init<>())
152155 .def (py::init<int >())
156+ .def (py::init<std::string&&>())
153157 .def (py::init<const ExampleMandA&>())
154158 .def (" add1" , &ExampleMandA::add1)
155159 .def (" add2" , &ExampleMandA::add2)
@@ -161,6 +165,7 @@ TEST_SUBMODULE(methods_and_attributes, m) {
161165 .def (" add8" , &ExampleMandA::add8)
162166 .def (" add9" , &ExampleMandA::add9)
163167 .def (" add10" , &ExampleMandA::add10)
168+ .def (" consume_str" , &ExampleMandA::consume_str)
164169 .def (" self1" , &ExampleMandA::self1)
165170 .def (" self2" , &ExampleMandA::self2)
166171 .def (" self3" , &ExampleMandA::self3)
0 commit comments