Skip to content
Snippets Groups Projects
Commit ec8089cd authored by Alexander Dielen's avatar Alexander Dielen
Browse files

placement-new constructors are deprecated

parent dbcca72f
No related branches found
No related tags found
No related merge requests found
......@@ -195,12 +195,12 @@ void expose_vec(py::module& m, const char *_name) {
.def_static("size", &Vector::size)
.def_static("vectorized", &Vector::vectorized)
.def("__init__", [](Vector& _self, py::array_t<Scalar, py::array::c_style | py::array::forcecast> _arr) {
.def(py::init([](py::array_t<Scalar, py::array::c_style | py::array::forcecast> _arr) {
if (_arr.size() != N) {
throw std::runtime_error("Incompatible array size!");
}
new (&_self) Vector(_arr.data());
});
return Vector(_arr.data());
}));
;
defInitMod<Scalar, Vector>(m, classVector);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment