I have been searching for a method to convert a constant iterator to an iterator and I stumbled upon this StackOverflow question:
How to remove constness of const_iterator?
An answer suggested to use this template function:
template <typename Container, typename ConstIterator>
typename Container::iterator remove_constness(Container& c, ConstIterator it)
{
return c.erase(it, it);
}
What I am confused about is how to go about implementing (calling) this function within my main code. I plan to use this code to convert a CGAL Ccb_halfedge_const_iterator to its non-constant counterpart. If the name of my Ccb_halfedge_const_iterator is dcel_circulator, how would I call this function:
typename Container::iterator remove_constness(Container& c, ConstIterator it)
{
return c.erase(it, it);
}
within my main code?