diff --git a/libsrc/core/archive.cpp b/libsrc/core/archive.cpp index 5454b929..d394c49c 100644 --- a/libsrc/core/archive.cpp +++ b/libsrc/core/archive.cpp @@ -10,24 +10,24 @@ namespace ngcore { // clang-tidy should ignore this static object - static std::unique_ptr> type_register; // NOLINT + static std::map type_register; // NOLINT const detail::ClassArchiveInfo& Archive :: GetArchiveRegister(const std::string& classname) { - if(type_register == nullptr) type_register = - std::make_unique>(); - return (*type_register)[classname]; + // if(type_register == nullptr) type_register = + // std::make_unique>(); + return (type_register)[classname]; } void Archive :: SetArchiveRegister(const std::string& classname, const detail::ClassArchiveInfo& info) { - if(type_register == nullptr) type_register = - std::make_unique>(); - (*type_register)[classname] = info; + // if(type_register == nullptr) type_register = + // std::make_unique>(); + (type_register)[classname] = info; } bool Archive :: IsRegistered(const std::string& classname) { - if(type_register == nullptr) type_register = - std::make_unique>(); - return type_register->count(classname) != 0; + // if(type_register == nullptr) type_register = + // std::make_unique>(); + return type_register.count(classname) != 0; } #ifdef NETGEN_PYTHON diff --git a/libsrc/core/archive.hpp b/libsrc/core/archive.hpp index 604a3f26..e9f28ef9 100644 --- a/libsrc/core/archive.hpp +++ b/libsrc/core/archive.hpp @@ -150,7 +150,8 @@ namespace ngcore void* (*downcaster)(const std::type_info&, void*); // Archive constructor arguments - std::function cargs_archiver; + // std::function cargs_archiver; + void (*cargs_archiver)(Archive&, void*); #ifdef NETGEN_PYTHON // std::function anyToPyCaster;