mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2494 from atgeirr/fix-ptr-overload
Fix ptr() template for strict compilers (clang)
This commit is contained in:
commit
070fafb31f
@ -242,8 +242,8 @@ protected:
|
|||||||
constexpr static bool value = true;
|
constexpr static bool value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T1>
|
template<class T1, class Deleter>
|
||||||
struct is_ptr<std::unique_ptr<T1>> {
|
struct is_ptr<std::unique_ptr<T1, Deleter>> {
|
||||||
constexpr static bool value = true;
|
constexpr static bool value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -278,13 +278,14 @@ protected:
|
|||||||
//! \brief Handler for smart pointers.
|
//! \brief Handler for smart pointers.
|
||||||
//! \details If data is POD or a string, we pass it to the underlying serializer,
|
//! \details If data is POD or a string, we pass it to the underlying serializer,
|
||||||
//! if not we assume a complex type.
|
//! if not we assume a complex type.
|
||||||
template<template<class T> class PtrType, class T1>
|
template<class PtrType>
|
||||||
void ptr(const PtrType<T1>& data)
|
void ptr(const PtrType& data)
|
||||||
{
|
{
|
||||||
|
using T1 = typename PtrType::element_type;
|
||||||
bool value = data ? true : false;
|
bool value = data ? true : false;
|
||||||
(*this)(value);
|
(*this)(value);
|
||||||
if (m_op == Operation::UNPACK && value) {
|
if (m_op == Operation::UNPACK && value) {
|
||||||
const_cast<PtrType<T1>&>(data).reset(new T1);
|
const_cast<PtrType&>(data).reset(new T1);
|
||||||
}
|
}
|
||||||
if (data)
|
if (data)
|
||||||
data->serializeOp(*this);
|
data->serializeOp(*this);
|
||||||
|
@ -235,7 +235,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void apply( const X& x, Y& y ) const
|
virtual void apply( const X& x, Y& y ) const override
|
||||||
{
|
{
|
||||||
for (auto row = A_.begin(); row.index() < interiorSize_; ++row)
|
for (auto row = A_.begin(); row.index() < interiorSize_; ++row)
|
||||||
{
|
{
|
||||||
@ -252,7 +252,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// y += \alpha * A * x
|
// y += \alpha * A * x
|
||||||
virtual void applyscaleadd (field_type alpha, const X& x, Y& y) const
|
virtual void applyscaleadd (field_type alpha, const X& x, Y& y) const override
|
||||||
{
|
{
|
||||||
for (auto row = A_.begin(); row.index() < interiorSize_; ++row)
|
for (auto row = A_.begin(); row.index() < interiorSize_; ++row)
|
||||||
{
|
{
|
||||||
@ -266,7 +266,7 @@ public:
|
|||||||
ghostLastProject( y );
|
ghostLastProject( y );
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual const matrix_type& getmat() const { return A_for_precond_; }
|
virtual const matrix_type& getmat() const override { return A_for_precond_; }
|
||||||
|
|
||||||
communication_type* comm()
|
communication_type* comm()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user