From 89bb8776ea8ff1699ec340bf279e05a78b503687 Mon Sep 17 00:00:00 2001 From: froejdh_e Date: Fri, 25 Jul 2025 11:44:27 +0200 Subject: [PATCH] check Ndim on drop_first_dim --- include/aare/NDView.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/include/aare/NDView.hpp b/include/aare/NDView.hpp index c946c26..0aa4f78 100644 --- a/include/aare/NDView.hpp +++ b/include/aare/NDView.hpp @@ -35,6 +35,7 @@ Shape make_shape(const std::vector &shape) { */ template Shape drop_first_dim(const Shape &shape) { + static_assert(Ndim > 1, "Cannot drop first dimension from a 1D shape"); Shape new_shape; std::copy(shape.begin() + 1, shape.end(), new_shape.begin()); return new_shape;