From: Matthias Maier Date: Tue, 2 Apr 2024 21:07:17 +0000 (-0500) Subject: Vectorization: move assert into constructor X-Git-Tag: v9.6.0-rc1~400^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f7f5c5b7a995418c413071d22578722fb0312753;p=dealii.git Vectorization: move assert into constructor --- 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.