diff --git a/include/pybind11/numpy.h b/include/pybind11/numpy.h index 50eb682d0..af0f5ae2c 100644 --- a/include/pybind11/numpy.h +++ b/include/pybind11/numpy.h @@ -337,8 +337,9 @@ public: array() : array(0, static_cast(nullptr)) {} - array(const pybind11::dtype &dt, const std::vector &shape, - const std::vector &strides, const void *ptr = nullptr, + template + array(const pybind11::dtype &dt, const Shape &shape, + const Strides &strides, const void *ptr = nullptr, handle base = handle()) { auto& api = detail::npy_api::get(); auto ndim = shape.size(); @@ -536,7 +537,7 @@ protected: throw std::runtime_error("array is not writeable"); } - static std::vector default_strides(const std::vector& shape, size_t itemsize) { + template static std::vector default_strides(const Shape& shape, size_t itemsize) { auto ndim = shape.size(); std::vector strides(ndim); if (ndim) {