From c0d394ebf55de436fd589e5868e490e9369fd4d1 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Mon, 15 Jan 2024 08:16:14 +0100 Subject: [PATCH] introduce 'shallow_archive' member --- libsrc/core/archive.hpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libsrc/core/archive.hpp b/libsrc/core/archive.hpp index 6db37a07..d7546060 100644 --- a/libsrc/core/archive.hpp +++ b/libsrc/core/archive.hpp @@ -57,6 +57,17 @@ namespace ngcore }; + + + template + class has_shallow_archive : public std::false_type {}; + + template + class has_shallow_archive> + : public std::is_same {}; + + + #ifdef NETGEN_PYTHON pybind11::object CastAnyToPy(const std::any& a); #endif // NETGEN_PYTHON @@ -501,7 +512,7 @@ namespace ngcore template Archive& operator & (std::shared_ptr& ptr) { - if constexpr(has_shared_from_this2::value) + if constexpr(has_shallow_archive::value) if (shallow_to_python) { Shallow (ptr);