PIMap range-for decomposition declaration support
This commit is contained in:
@@ -107,6 +107,7 @@ public:
|
|||||||
iterator(): parent(0), pos(0) {}
|
iterator(): parent(0), pos(0) {}
|
||||||
const Key & key() const {return const_cast<PIMap<Key, T> * >(parent)->_key(pos);}
|
const Key & key() const {return const_cast<PIMap<Key, T> * >(parent)->_key(pos);}
|
||||||
T & value() {return const_cast<PIMap<Key, T> * >(parent)->_value(pos);}
|
T & value() {return const_cast<PIMap<Key, T> * >(parent)->_value(pos);}
|
||||||
|
inline PIPair<Key, T> operator *() const {return PIPair<Key, T>(const_cast<PIMap<Key, T> * >(parent)->_key(pos), const_cast<PIMap<Key, T> * >(parent)->_value(pos));}
|
||||||
void operator ++() {++pos;}
|
void operator ++() {++pos;}
|
||||||
void operator ++(int) {++pos;}
|
void operator ++(int) {++pos;}
|
||||||
void operator --() {--pos;}
|
void operator --() {--pos;}
|
||||||
@@ -125,6 +126,7 @@ public:
|
|||||||
reverse_iterator(): parent(0), pos(0) {}
|
reverse_iterator(): parent(0), pos(0) {}
|
||||||
const Key & key() const {return const_cast<PIMap<Key, T> * >(parent)->_key(pos);}
|
const Key & key() const {return const_cast<PIMap<Key, T> * >(parent)->_key(pos);}
|
||||||
T & value() const {return const_cast<PIMap<Key, T> * >(parent)->_value(pos);}
|
T & value() const {return const_cast<PIMap<Key, T> * >(parent)->_value(pos);}
|
||||||
|
inline PIPair<Key, T> operator *() const {return PIPair<Key, T>(const_cast<PIMap<Key, T> * >(parent)->_key(pos), const_cast<PIMap<Key, T> * >(parent)->_value(pos));}
|
||||||
void operator ++() {--pos;}
|
void operator ++() {--pos;}
|
||||||
void operator ++(int) {--pos;}
|
void operator ++(int) {--pos;}
|
||||||
void operator --() {++pos;}
|
void operator --() {++pos;}
|
||||||
|
|||||||
Reference in New Issue
Block a user