From: Matthias Maier Date: Mon, 15 Mar 2021 22:30:37 +0000 (-0500) Subject: examples/stpe-69: use std::copy_n instead of std::copy X-Git-Tag: v9.3.0-rc1~324^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11919%2Fhead;p=dealii.git examples/stpe-69: use std::copy_n instead of std::copy A std::copy_n is more more elegant than the std::copy variant that need to take the address of an element past the momentum. Thanks to @guermond and @ejtovar for pointing this out. --- diff --git a/examples/step-69/step-69.cc b/examples/step-69/step-69.cc index db5cb11c42..4c079630ee 100644 --- a/examples/step-69/step-69.cc +++ b/examples/step-69/step-69.cc @@ -1329,7 +1329,7 @@ namespace Step69 ProblemDescription::momentum(const state_type &U) { Tensor<1, dim> result; - std::copy(&U[1], &U[1 + dim], &result[0]); + std::copy_n(&U[1], dim, &result[0]); return result; }