Skip to content

Commit cad03df

Browse files
PUP: Fix support for STL containers with custom comparators (#3458)
1 parent 1038c1f commit cad03df

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/util/pup_stl.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,23 +161,23 @@ namespace PUP {
161161
{
162162
c.clear();
163163
}
164-
template <class dtype>
165-
inline void reserve_if_applicable(std::set<dtype> &c, size_t nElem)
164+
template <class dtype, class cmp>
165+
inline void reserve_if_applicable(std::set<dtype, cmp> &c, size_t nElem)
166166
{
167167
c.clear();
168168
}
169-
template <class dtype>
170-
inline void reserve_if_applicable(std::multiset<dtype> &c, size_t nElem)
169+
template <class dtype, class cmp>
170+
inline void reserve_if_applicable(std::multiset<dtype, cmp> &c, size_t nElem)
171171
{
172172
c.clear();
173173
}
174-
template <class K, class V>
175-
inline void reserve_if_applicable(std::map<K, V> &c, size_t nElem)
174+
template <class K, class V, class cmp>
175+
inline void reserve_if_applicable(std::map<K, V, cmp> &c, size_t nElem)
176176
{
177177
c.clear();
178178
}
179-
template <class K, class V>
180-
inline void reserve_if_applicable(std::multimap<K, V> &c, size_t nElem)
179+
template <class K, class V, class cmp>
180+
inline void reserve_if_applicable(std::multimap<K, V, cmp> &c, size_t nElem)
181181
{
182182
c.clear();
183183
}

0 commit comments

Comments
 (0)