Merge pull request #4055 from akva2/eclmpiserializer_map

eclmpiserializer: improve map handler
This commit is contained in:
Bård Skaflestad 2022-09-02 21:01:47 +02:00 committed by GitHub
commit b3e517a8ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -233,9 +233,8 @@ public:
//! \brief Handler for maps.
//! \tparam Map map type
//! \tparam complexType Whether or not Data in map is a complex type
//! \param map The map to (de-)serialize
template<class Map, bool complexType = true>
template<class Map>
void map(Map& data)
{
using Key = typename Map::key_type;
@ -247,7 +246,7 @@ public:
this->vector(d);
else if constexpr (is_ptr<Data>::value)
this->ptr(d);
else if constexpr (complexType)
else if constexpr (has_serializeOp<Data>::value)
d.serializeOp(*this);
else
(*this)(d);
@ -257,6 +256,8 @@ public:
{
if constexpr (is_pair<Key>::value)
pair(d);
else if constexpr (has_serializeOp<Key>::value)
d.serializeOp(*this);
else
(*this)(d);
};