 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
 |
string
& list::operator ++ () {
//prefix
|
|
if (!ptr || !(ptr->next)) {
|
|
//consider what other alternatives there
are
|
string * temp = new string; //just in
case
|
|
return *temp;
|
|
}
|
|
ptr = ptr->next;
|
|
return ptr->obj;
|
|
}
|
|
|
string
operator ++ (int){ //postfix
|
|
string temp;
|
|
if (!ptr) {
|
|
temp = “\0”; //what does this do?
|
|
return temp; //and this?
|
|
}
|
|
temp = ptr->obj; //and this?
|
|
ptr = ptr->next; //and this?
|
|
return temp; //and this?
|
|
}
|
|