diff --git a/include/nanobind/ndarray.h b/include/nanobind/ndarray.h index de0c639d..abcb7f3c 100644 --- a/include/nanobind/ndarray.h +++ b/include/nanobind/ndarray.h @@ -188,13 +188,14 @@ struct unused { /// ndarray_config describes a requested array configuration struct ndarray_config { - int device_type; - char order; - bool ro; - dlpack::dtype dtype; - int32_t ndim; - int64_t *shape; + int device_type = 0; + char order = '\0'; + bool ro = false; + dlpack::dtype dtype { }; + int32_t ndim = -1; + int64_t *shape = nullptr; + ndarray_config() = default; template ndarray_config(T) : device_type(T::DeviceType::value), order((char) T::Order::value),