From 6b346926ec638edf06507abd01fb5c1ffeec8ed0 Mon Sep 17 00:00:00 2001 From: Joachim Schoeberl Date: Sun, 14 Jan 2024 04:52:19 +0100 Subject: [PATCH] if constexpr --- libsrc/core/archive.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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()) {