From feb74d49c2afbf15707a2e78b836b1402c792432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joachim=20Sch=C3=B6berl?= Date: Wed, 31 May 2017 07:53:24 +0200 Subject: [PATCH] use static class variable rather then static function variable --- libsrc/meshing/meshclass.cpp | 1 + libsrc/meshing/meshclass.hpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/libsrc/meshing/meshclass.cpp b/libsrc/meshing/meshclass.cpp index 356192fc..a40deef9 100644 --- a/libsrc/meshing/meshclass.cpp +++ b/libsrc/meshing/meshclass.cpp @@ -5768,6 +5768,7 @@ namespace netgen materials.Elem(domnr) = new string(mat); } + string Mesh :: defaultmat = "default"; const string & Mesh :: GetMaterial (int domnr) const { if (domnr <= materials.Size()) diff --git a/libsrc/meshing/meshclass.hpp b/libsrc/meshing/meshclass.hpp index 40d8ebb4..4cf9c605 100644 --- a/libsrc/meshing/meshclass.hpp +++ b/libsrc/meshing/meshclass.hpp @@ -593,9 +593,9 @@ namespace netgen DLL_HEADER void SetMaterial (int domnr, const string & mat); /// const string & GetMaterial (int domnr) const; + static string defaultmat; const string * GetMaterialPtr (int domnr) const // 1-based { - static string defaultmat = "default"; return domnr <= materials.Size() ? materials.Get(domnr) : &defaultmat; }