From 208981d85889981286060dc1fffad826ab356562 Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Mon, 28 Oct 2024 11:16:32 -0400 Subject: [PATCH] Fix C++20 Tensor initialization --- include/deal.II/base/tensor.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index 40ba24ba1c..b7f2c0e530 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1292,7 +1292,11 @@ Tensor::Tensor() // returning a zero instead. []( const std::index_sequence &) constexpr -> decltype(values) { - if constexpr (rank_ == 1) + if constexpr (dim == 0) + { + return {}; + } + else if constexpr (rank_ == 1) { auto get_zero_and_ignore_argument = [](int) { return internal::NumberType::value(0.0); -- 2.39.5