mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-16 20:24:48 -06:00
Merge pull request #4050 from akva2/eclmpiserializer_ptr
eclmpiserializer: improve ptr handler
This commit is contained in:
commit
dff553db59
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user