Skip to content

Commit

Permalink
Fixed CentOS7 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koefferlein committed Sep 20, 2024
1 parent ff70818 commit 43235a1
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/db/db/dbPolygonGenerators.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,18 @@ class PGPolyContour
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:
Expand Down

0 comments on commit 43235a1

Please sign in to comment.