mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-14 22:13:25 -06:00
Simplify ptr(), avoiding a template template parameter.
Since unique_ptr<T, Deleter> takes two arguments it cannot strictly speaking be used via a template template parameter that takes one, even though the second has a default. GCC allows this anyway, but not clang.
This commit is contained in:
parent
53d636a3b1
commit
652c7d239b
@ -278,13 +278,14 @@ 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<template<class T> class PtrType, class T1>
|
||||
void ptr(const PtrType<T1>& data)
|
||||
template<class PtrType>
|
||||
void ptr(const PtrType& data)
|
||||
{
|
||||
using T1 = typename PtrType::element_type;
|
||||
bool value = data ? true : false;
|
||||
(*this)(value);
|
||||
if (m_op == Operation::UNPACK && value) {
|
||||
const_cast<PtrType<T1>&>(data).reset(new T1);
|
||||
const_cast<PtrType&>(data).reset(new T1);
|
||||
}
|
||||
if (data)
|
||||
data->serializeOp(*this);
|
||||
|
Loading…
Reference in New Issue
Block a user