From ef751738a029ecded8ca68e2ffdfca2b0ab68610 Mon Sep 17 00:00:00 2001 From: "Garth N. Wells" Date: Sun, 3 Nov 2024 11:00:32 +0000 Subject: [PATCH] Small improvement --- python/dolfinx/wrappers/array.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/dolfinx/wrappers/array.h b/python/dolfinx/wrappers/array.h index f8cd5a1282..5f4289dff0 100644 --- a/python/dolfinx/wrappers/array.h +++ b/python/dolfinx/wrappers/array.h @@ -13,6 +13,8 @@ #include #include +#include + namespace nb = nanobind; namespace dolfinx_wrappers @@ -27,7 +29,7 @@ template auto as_nbarray(V&& x, std::size_t ndim, const std::size_t* shape) { using _V = std::decay_t; - _V* ptr = new _V(std::move(x)); + _V* ptr = new _V(std::forward(x)); return nb::ndarray( ptr->data(), ndim, shape, nb::capsule(ptr, [](void* p) noexcept { delete (_V*)p; }));