diff options
author | Neal E. Coombes <nealc@trdlnk.com> | 2005-06-04 12:18:25 +0000 |
---|---|---|
committer | Murray Cumming <murrayc@src.gnome.org> | 2005-06-04 12:18:25 +0000 |
commit | ff1e6cbb000150ac2100b3af61edcdb0c5cd7381 (patch) | |
tree | d80e734a2558827f9e58e50c28b16bd1f7677e3d | |
parent | 5ec5f725810a2b04132b71c30fa7d0c0445bf479 (diff) | |
download | sigc++-ff1e6cbb000150ac2100b3af61edcdb0c5cd7381.tar.gz |
Modified temp_slot_list to be a temporary view into a slot list. Instead
2005-05-16 Neal E. Coombes <nealc@trdlnk.com>
* sigc++/signal_base.h: Modified temp_slot_list to be a temporary view
into a slot list. Instead of emptying the original it now simply tacks
a placeholder to the end of the original. It then uses this as it's
'end' iterator. This should allow for conscious recursiveness, as well
as inserting a slot to any position in the slot list during emittion.
See bug #303896.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | sigc++/signal_base.h | 14 |
2 files changed, 16 insertions, 7 deletions
@@ -1,3 +1,12 @@ +2005-05-16 Neal E. Coombes <nealc@trdlnk.com> + + * sigc++/signal_base.h: Modified temp_slot_list to be a temporary view + into a slot list. Instead of emptying the original it now simply tacks + a placeholder to the end of the original. It then uses this as it's + 'end' iterator. This should allow for conscious recursiveness, as well + as inserting a slot to any position in the slot list during emittion. + See bug #303896. + 2005-06-04 Friedemann Kleint <kleint@bifab.de> * sigc++/macros/limit_reference.h.m4: diff --git a/sigc++/signal_base.h b/sigc++/signal_base.h index 5ff8cc9..aedf03d 100644 --- a/sigc++/signal_base.h +++ b/sigc++/signal_base.h @@ -176,22 +176,22 @@ struct temp_slot_list temp_slot_list(slot_list &slots) : slots_(slots) { - temp_slots_.swap(slots_); + placeholder = slots_.insert(slots_.end(), slot_base()); } ~temp_slot_list() { - slots_.splice(slots_.begin(), temp_slots_); + slots_.erase(placeholder); } - iterator begin() { return temp_slots_.begin(); } - iterator end() { return temp_slots_.end(); } - const_iterator begin() const { return temp_slots_.begin(); } - const_iterator end() const { return temp_slots_.end(); } + iterator begin() { return slots_.begin(); } + iterator end() { return placeholder; } + const_iterator begin() const { return slots_.begin(); } + const_iterator end() const { return placeholder; } private: slot_list &slots_; - slot_list temp_slots_; + slot_list::iterator placeholder; }; } /* namespace internal */ |