From a8f3947a70fda6c618ffb202c356d16d6cf00f02 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 19 Jan 2024 13:48:09 -0700 Subject: [PATCH] Use simpler copy/move initialization in Tensor. --- include/deal.II/base/tensor.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/include/deal.II/base/tensor.h b/include/deal.II/base/tensor.h index a6aed73afe..0bae03a7b5 100644 --- a/include/deal.II/base/tensor.h +++ b/include/deal.II/base/tensor.h @@ -1494,20 +1494,16 @@ operator Tensor<1, dim, Tensor>() const template constexpr DEAL_II_ALWAYS_INLINE Tensor::Tensor(const Tensor &other) -{ - for (unsigned int i = 0; i < dim; ++i) - values[i] = other.values[i]; -} + : values(other.values) +{} template constexpr DEAL_II_ALWAYS_INLINE Tensor::Tensor(Tensor &&other) noexcept -{ - for (unsigned int i = 0; i < dim; ++i) - values[i] = other.values[i]; -} + : values(std::move(other.values)) +{} # endif -- 2.39.5