Lines Matching defs:new
35 auto *ptr = new NoConstructor();
115 m.def("return_class_1", []() -> BaseClass* { return new DerivedClass1(); });
116 m.def("return_class_2", []() -> BaseClass* { return new DerivedClass2(); });
118 if (n == 1) return new DerivedClass1();
119 if (n == 2) return new DerivedClass2();
120 return new BaseClass();
160 return std::unique_ptr<MyBase>(new MyBase());
166 return std::unique_ptr<MyDerived>(new MyDerived());
207 auto def = new PyMethodDef{"f", f, METH_VARARGS, nullptr};
214 static void *operator new(size_t s) { py::print("A new", s); return ::operator new(s); }
215 static void *operator new(size_t s, void *ptr) { py::print("A placement-new", s); return ptr; }
220 static void *operator new(size_t s) { py::print("B new", s); return ::operator new(s); }
221 static void *operator new(size_t s, void *ptr) { py::print("B placement-new", s); return ptr; }
226 static void *operator new(size_t s) { py::print("C new", s); return ::operator new(s); }
227 static void *operator new(size_t s, void *ptr) { py::print("C placement-new", s); return ptr; }
238 static void *operator new(size_t s) { py::print("D new", s); return ::operator new(s); }
239 static void *operator new(size_t s, void *ptr) { py::print("D placement-new", s); return ptr; }