From 3d89a4e35e44a8313a6158c915ad67993b519c21 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 11 May 2019 12:31:20 -0400 Subject: [PATCH] Avoid static function --- examples/step-43/step-43.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/examples/step-43/step-43.cc b/examples/step-43/step-43.cc index 9f7f7621a4..1e5478f869 100644 --- a/examples/step-43/step-43.cc +++ b/examples/step-43/step-43.cc @@ -226,20 +226,12 @@ namespace Step43 private: static std::vector> centers; - - static std::vector> get_centers(); }; template - std::vector> - KInverse::centers = KInverse::get_centers(); - - - template - std::vector> KInverse::get_centers() - { + std::vector> KInverse::centers = []() { const unsigned int N = (dim == 2 ? 40 : (dim == 3 ? 100 : throw ExcNotImplemented())); @@ -249,7 +241,7 @@ namespace Step43 centers_list[i][d] = static_cast(rand()) / RAND_MAX; return centers_list; - } + }(); -- 2.39.5