I recently view the source code of SGI STL. I want to know whether I can use the "->" operator to replace the (*node).data to implement the operator*(), like this:
reference operator*() const {return (*node).data;}
replaced by:
reference operator*() const {return node->data;}
in addition:
node is a pointer which points to a struct object, like this:
template<class T>
struct __list_node {
typedef void * void_pointer;
void_pointer prev;
void_pointer next;
T data;
};
nodeand does it overloadoperator->or unaryoperator*?++aanda++could affectain different ways – or just likec << ncould have side-effects and mean something different from bit-wise shifting, to name the ever-popular early overload changing an operator meaning.