From f4e30cb140fc617d55478b924ddcc3ae69a4d7cf Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 15 Mar 2021 17:30:37 -0500 Subject: [PATCH] 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. --- examples/step-69/step-69.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.5