diff --git a/libsrc/core/utils.hpp b/libsrc/core/utils.hpp index 65db4fff..8dd5c531 100644 --- a/libsrc/core/utils.hpp +++ b/libsrc/core/utils.hpp @@ -23,6 +23,10 @@ namespace ngcore NGCORE_API std::string Demangle(const char* typeinfo); + template + NGCORE_API std::string GetName(const T& obj) + { return Demangle(typeid(obj).name()); } + #if defined(__GNUC__) inline bool likely (bool x) { return bool(__builtin_expect(long(x), 1L)); } inline bool unlikely (bool x) { return bool(__builtin_expect(long(x), 0L)); } diff --git a/libsrc/occ/occpkg.cpp b/libsrc/occ/occpkg.cpp index a4f019a7..62d0fe0b 100644 --- a/libsrc/occ/occpkg.cpp +++ b/libsrc/occ/occpkg.cpp @@ -519,7 +519,8 @@ namespace netgen stringstream str; occgeometry->GetTopologyTree (str); - char* cstr = (char*)str.str().c_str(); + auto txt = str.str(); + char* cstr = (char*) txt.c_str(); (*testout) << cstr << endl;