Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
const item& operator= (const item& right);
- bool empty() { return _prev == this; }
- bool is_on_list() { return !empty(); }
+ bool empty() const { return _prev == this; }
+ bool is_on_list() const { return !empty(); }
bool remove_myself() {
if (_next == this) {
const item& operator= (const item& right);
- bool empty() { return _prev == this; }
- bool is_on_list() { return !empty(); }
+ bool empty() const { return _prev == this; }
+ bool is_on_list() const { return !empty(); }
bool remove_myself() {
if (_next == this) {
assert(_head.empty());
}
- bool empty() {
+ bool empty() const {
return _head.empty();
}
next = cur->_next;
return *this;
}
- bool end() {
+ bool end() const {
return cur == head;
}
};
xlist* get_list() { return _list; }
- bool is_on_list() { return _list ? true:false; }
+ bool is_on_list() const { return _list ? true:false; }
bool remove_myself() {
if (_list) {
_list->remove(this);
assert(_back == 0);
}
- int size() { return _size; }
- bool empty() {
+ int size() const { return _size; }
+ bool empty() const {
assert((bool)_front == (bool)_size);
return _front == 0;
}
cur = cur->_next;
return *this;
}
- bool end() { return cur == 0; }
+ bool end() const { return cur == 0; }
};
iterator begin() { return iterator(_front); }