Skip to content

Commit

Permalink
Fix: ObjectPointerCollection::unique() now removes elements at end.
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Apr 7, 2017
1 parent 31b29d7 commit 20a3dce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/osmium/object_pointer_collection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ namespace osmium {
*/
template <typename TEqual>
void unique(TEqual&& equal) {
std::unique(m_objects.begin(), m_objects.end(), std::forward<TEqual>(equal));
const auto last = std::unique(m_objects.begin(), m_objects.end(), std::forward<TEqual>(equal));
m_objects.erase(last, m_objects.end());
}

/**
Expand Down

0 comments on commit 20a3dce

Please sign in to comment.