if constexpr

This commit is contained in:
Joachim Schoeberl 2024-01-14 04:52:19 +01:00
parent 1ff8c97b1d
commit 6b346926ec

View File

@ -501,7 +501,8 @@ namespace ngcore
template <typename T> template <typename T>
Archive& operator & (std::shared_ptr<T>& ptr) Archive& operator & (std::shared_ptr<T>& ptr)
{ {
if (has_shared_from_this2<T>::value && shallow_to_python) if constexpr(has_shared_from_this2<T>::value)
if (shallow_to_python)
{ {
Shallow (ptr); Shallow (ptr);
return *this; return *this;