diff --git a/ebos/eclmpiserializer.hh b/ebos/eclmpiserializer.hh index d11027c04..1b5f6c316 100644 --- a/ebos/eclmpiserializer.hh +++ b/ebos/eclmpiserializer.hh @@ -495,8 +495,6 @@ protected: } //! \brief Handler for smart pointers. - //! \details If data is POD or a string, we pass it to the underlying serializer, - //! if not we assume a complex type. template void ptr(const PtrType& data) { @@ -506,8 +504,12 @@ protected: if (m_op == Operation::UNPACK && value) { const_cast(data).reset(new T1); } - if (data) - data->serializeOp(*this); + if (data) { + if constexpr (has_serializeOp::value) + data->serializeOp(*this); + else + (*this)(*data); + } } Parallel::Communication m_comm; //!< Communicator to broadcast using