@@ -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
@@ -212,6 +215,7 @@ TEST_SUBMODULE(methods_and_attributes, m) {
212215 py::class_<ExampleMandA> emna (m, " ExampleMandA" );
213216 emna.def (py::init<>())
214217 .def (py::init<int >())
218+ .def (py::init<std::string&&>())
215219 .def (py::init<const ExampleMandA&>())
216220 .def (" add1" , &ExampleMandA::add1)
217221 .def (" add2" , &ExampleMandA::add2)
@@ -223,6 +227,7 @@ TEST_SUBMODULE(methods_and_attributes, m) {
223227 .def (" add8" , &ExampleMandA::add8)
224228 .def (" add9" , &ExampleMandA::add9)
225229 .def (" add10" , &ExampleMandA::add10)
230+ .def (" consume_str" , &ExampleMandA::consume_str)
226231 .def (" self1" , &ExampleMandA::self1)
227232 .def (" self2" , &ExampleMandA::self2)
228233 .def (" self3" , &ExampleMandA::self3)
0 commit comments