Fixed CentOS7 builds

This commit is contained in:
Matthias Koefferlein 2024-09-20 23:49:16 +02:00
parent ff708186ec
commit 43235a1ac2
1 changed files with 11 additions and 8 deletions

View File

@ -182,15 +182,18 @@ public:
template <class I>
iterator insert (iterator at, I from, I to)
{
m_size += std::distance (from, to);
#if 0
// NOTE: in some STL m_contour.insert already returns the new iterator
size_t index_at = at - m_contour.begin ();
m_contour.insert (at, from, to);
return m_contour.begin () + index_at;
#else
return m_contour.insert (at, from, to);
#endif
// For CentOS7 we compute the result explicitly
m_size += std::distance (from, to);
if (at == m_contour.begin ()) {
m_contour.insert (at, from, to);
return m_contour.begin ();
} else {
iterator prev = at;
--prev;
m_contour.insert (at, from, to);
return ++prev;
}
}
private: