iterator<is_const_iterator> ( StorageClass<T>& node) : __node(node) {};
iterator<is_const_iterator> (const iterator<is_const_iterator>& copy) : __node(copy.__node) {}; // copy constructor
+ // ForwardIterator methods
+
// postfix increment operator
self_type operator++()
{
// prefix increment operator
self_type operator++(int unused)
{
- __node = __node->get_next();
+ __node = __node.get_next();
return *this;
}
+ // BidirectionalIterator methods
+
+ // postfix decrement
+ self_type operator--()
+ {
+ self_type original = *this; // keep reference to value that is to be returned
+ this->__node.get_previous();
+ return original;
+ };
+
+ // prefix decrement
+ self_type operator--(int unused)
+ {
+ __node = __node->get_previous();
+ return *this;
+ };
+
+ // Comparison methods
bool operator==(const self_type& right_hand_side)
{
return __node == right_hand_side.__node;