Lines Matching refs:std

20     TestFactory1(int v) : value(std::to_string(v)) { print_created(this, value); }
21 TestFactory1(std::string v) : value(std::move(v)) { print_created(this, value); }
27 std::string value;
34 TestFactory2(int v) : value(std::to_string(v)) { print_created(this, value); }
35 TestFactory2(std::string v) : value(std::move(v)) { print_created(this, value); }
37 TestFactory2(TestFactory2 &&m) { value = std::move(m.value); print_move_created(this); }
38 TestFactory2 &operator=(TestFactory2 &&m) { value = std::move(m.value); print_move_assigned(this); return *this; }
39 std::string value;
47 TestFactory3(int v) : value(std::to_string(v)) { print_created(this, value); }
49 TestFactory3(std::string v) : value(std::move(v)) { print_created(this, value); }
50 TestFactory3(TestFactory3 &&m) { value = std::move(m.value); print_move_created(this); }
51 TestFactory3 &operator=(TestFactory3 &&m) { value = std::move(m.value); print_move_assigned(this); return *this; }
52 std::string value;
85 PyTF6(TestFactory6 &&base) : TestFactory6(std::move(base)) { alias = true; print_created(this, "move", value); }
87 PyTF6(PyTF6 &&f) : TestFactory6(std::move(f)) { print_move_created(this); }
89 PyTF6(std::string s) : TestFactory6((int) s.size()) { alias = true; print_created(this, s); }
109 PyTF7(PyTF7 &&f) : TestFactory7(std::move(f)) { print_move_created(this); }
122 static std::unique_ptr<TestFactory1> construct1(int a) { return std::unique_ptr<TestFactory1>(new TestFactory1(a)); }
124 static TestFactory1 *construct1_string(std::string a) { return new TestFactory1(a); }
130 static std::unique_ptr<TestFactory2> construct2(int a) { return std::unique_ptr<TestFactory2>(new TestFactory2(a)); }
132 static TestFactory2 construct2(std::string a) { return TestFactory2(a); }
138 static std::shared_ptr<TestFactory3> construct3(int a) { return std::shared_ptr<TestFactory3>(new TestFactory3(a)); }
173 .def(py::init([](unique_ptr_tag, std::string v) { return TestFactoryHelper::construct2(v); }))
183 py::class_<TestFactory3, std::shared_ptr<TestFactory3>>(m, "TestFactory3")
186 .def("__init__", [](TestFactory3 &self, std::string v) { new (&self) TestFactory3(v); }) // placement-new ctor
192 .def(py::init([](shared_ptr_tag, TF4_tag, int a) { return std::make_shared<TestFactory4>(a); }))
193 .def(py::init([](shared_ptr_tag, TF5_tag, int a) { return std::make_shared<TestFactory5>(a); }))
202 py::class_<TestFactory4, TestFactory3, std::shared_ptr<TestFactory4>>(m, "TestFactory4")
207 py::class_<TestFactory5, TestFactory3, std::shared_ptr<TestFactory5>>(m, "TestFactory5");
214 .def(py::init([](alias_tag, std::string s) { return PyTF6(s); }))
228 py::class_<TestFactory7, PyTF7, std::shared_ptr<TestFactory7>>(m, "TestFactory7")
239 [](mixed_tag, std::string s) { return TestFactory7((int) s.size()); },
240 [](mixed_tag, std::string s) { return new PyTF7((int) s.size()); }))
248 [](shared_ptr_tag, base_tag, int i) { return std::make_shared<TestFactory7>(i); },
249 [](shared_ptr_tag, base_tag, int i) { auto *p = new PyTF7(i); return std::shared_ptr<TestFactory7>(p); }))
251 [](shared_ptr_tag, invalid_base_tag, int i) { return std::make_shared<TestFactory7>(i); },
252 [](shared_ptr_tag, invalid_base_tag, int i) { return std::make_shared<TestFactory7>(i); })) // <-- invalid alias factory
266 static void *operator new(std::size_t s) {
318 .def("__init__", [](NoisyAlloc &a, int i, std::string) { new (&a) NoisyAlloc(i); })
329 py::class_<BadF1, PyBadF1, std::shared_ptr<BadF1>> bf1(m, "BadF1");
334 // incompatible factory function std::shared_ptr<T> return type: cannot convert shared_ptr<T> to holder
336 bf1.def(py::init([]() { return std::shared_ptr<BadF1Base>(new BadF1()); }));