Merge pull request #4050 from akva2/eclmpiserializer_ptr

eclmpiserializer: improve ptr handler
This commit is contained in:
Bård Skaflestad 2022-09-02 14:30:33 +02:00 committed by GitHub
commit dff553db59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<class PtrType>
void ptr(const PtrType& data)
{
@ -506,8 +504,12 @@ protected:
if (m_op == Operation::UNPACK && value) {
const_cast<PtrType&>(data).reset(new T1);
}
if (data)
data->serializeOp(*this);
if (data) {
if constexpr (has_serializeOp<T1>::value)
data->serializeOp(*this);
else
(*this)(*data);
}
}
Parallel::Communication m_comm; //!< Communicator to broadcast using