mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
eclmpiserializer: improve map handler
use has_serializeOp trait
This commit is contained in:
parent
a372a4d09e
commit
ade4cf978e
@ -233,9 +233,8 @@ public:
|
|||||||
|
|
||||||
//! \brief Handler for maps.
|
//! \brief Handler for maps.
|
||||||
//! \tparam Map map type
|
//! \tparam Map map type
|
||||||
//! \tparam complexType Whether or not Data in map is a complex type
|
|
||||||
//! \param map The map to (de-)serialize
|
//! \param map The map to (de-)serialize
|
||||||
template<class Map, bool complexType = true>
|
template<class Map>
|
||||||
void map(Map& data)
|
void map(Map& data)
|
||||||
{
|
{
|
||||||
using Key = typename Map::key_type;
|
using Key = typename Map::key_type;
|
||||||
@ -247,7 +246,7 @@ public:
|
|||||||
this->vector(d);
|
this->vector(d);
|
||||||
else if constexpr (is_ptr<Data>::value)
|
else if constexpr (is_ptr<Data>::value)
|
||||||
this->ptr(d);
|
this->ptr(d);
|
||||||
else if constexpr (complexType)
|
else if constexpr (has_serializeOp<Data>::value)
|
||||||
d.serializeOp(*this);
|
d.serializeOp(*this);
|
||||||
else
|
else
|
||||||
(*this)(d);
|
(*this)(d);
|
||||||
@ -257,6 +256,8 @@ public:
|
|||||||
{
|
{
|
||||||
if constexpr (is_pair<Key>::value)
|
if constexpr (is_pair<Key>::value)
|
||||||
pair(d);
|
pair(d);
|
||||||
|
else if constexpr (has_serializeOp<Key>::value)
|
||||||
|
d.serializeOp(*this);
|
||||||
else
|
else
|
||||||
(*this)(d);
|
(*this)(d);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user