I've written my own doubly linked list, complete with begin() and end() iterators. These work fine with traversing the list using a loop. However, as part of my assignment, I need to sort the list according to certain criteria. Since we haven't yet covered the chapter on sorting algorithms, we are allowed to use the sort function defined in the header. But sort(list.begin(), list.end(), compare) returns quite a few errors related to my iterator class:
error: no type named iterator_category
error: no type named value_type
error: no type named difference_type
error: no type named pointer
error: no type named reference
Additionally, I receive errors regarding the + and - operators. I understand how to define value_type, pointer, and reference, but I'm lost when it comes to the others. Is what I'm trying to do possible? Thanks!