diff --git a/libsrc/core/archive.hpp b/libsrc/core/archive.hpp index 52e7ed83..6db37a07 100644 --- a/libsrc/core/archive.hpp +++ b/libsrc/core/archive.hpp @@ -501,11 +501,12 @@ namespace ngcore template Archive& operator & (std::shared_ptr& ptr) { - if (has_shared_from_this2::value && shallow_to_python) - { - Shallow (ptr); - return *this; - } + if constexpr(has_shared_from_this2::value) + if (shallow_to_python) + { + Shallow (ptr); + return *this; + } if(Output()) {