From: Daniel Arndt Date: Sat, 11 May 2019 16:31:20 +0000 (-0400) Subject: Avoid static function X-Git-Tag: v9.1.0-rc1~62^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d89a4e35e44a8313a6158c915ad67993b519c21;p=dealii.git Avoid static function --- 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; - } + }();