From: Wolfgang Bangerth Date: Fri, 19 Jan 2024 20:48:09 +0000 (-0700) Subject: Use simpler copy/move initialization in Tensor. X-Git-Tag: relicensing~131^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16505%2Fhead;p=dealii.git Use simpler copy/move initialization in Tensor. --- 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