From f7f5c5b7a995418c413071d22578722fb0312753 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Tue, 2 Apr 2024 16:07:17 -0500 Subject: [PATCH] Vectorization: move assert into constructor --- include/deal.II/base/vectorization.h | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index 9511a853a1..c6603069ad 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -455,9 +455,6 @@ public: */ using value_type = Number; - static_assert(width == 1, - "You specified an illegal width that is not supported."); - /** * Default empty constructor, leaving the data in an uninitialized state * similar to float/double. @@ -469,6 +466,9 @@ public: */ VectorizedArray(const Number scalar) { + static_assert(width == 1, + "You specified an illegal width that is not supported."); + this->operator=(scalar); } @@ -478,7 +478,10 @@ public: template VectorizedArray(const std::initializer_list &list) : VectorizedArrayBase, 1>(list) - {} + { + static_assert(width == 1, + "You specified an illegal width that is not supported."); + } /** * This function assigns a scalar to the current object. -- 2.39.5