* \author unknown
*/
-
-
#ifndef LYX_ALGO_H
#define LYX_ALGO_H
/**
- * copy elements in the given range to the output iterator
+ * copy elements in the given range to the output iterator
* if the predicate evaluates as true
*/
template <class InputIter, class OutputIter, class Func>
#endif
}
+/// Remove all duplicate entries in c.
+template<class C>
+void eliminate_duplicates(C & c)
+{
+ std::sort(c.begin(), c.end());
+ typename C::iterator p = std::unique(c.begin(), c.end());
+ c.erase(p, c.end());
+}
+
} // namespace lyx
#endif // LYX_ALGO_H