diff --git a/include/boost/signals/detail/named_slot_map.hpp b/include/boost/signals/detail/named_slot_map.hpp index 815406d..3592f4c 100644 --- a/include/boost/signals/detail/named_slot_map.hpp +++ b/include/boost/signals/detail/named_slot_map.hpp @@ -60,7 +60,8 @@ public: typedef const stored_group& first_argument_type; typedef const stored_group& second_argument_type; - group_bridge_compare(const Compare& c) : comp(c) {} + group_bridge_compare(const Compare& c) : comp(c) + { } bool operator()(const stored_group& k1, const stored_group& k2) const { @@ -92,13 +93,39 @@ class BOOST_SIGNALS_DECL named_slot_map_iterator : connection_slot_pair, forward_traversal_tag> inherited; public: - named_slot_map_iterator(); - named_slot_map_iterator(const named_slot_map_iterator&); - named_slot_map_iterator& operator=(const named_slot_map_iterator&); - - connection_slot_pair& dereference() const; - void increment(); - bool equal(const named_slot_map_iterator& other) const; + named_slot_map_iterator() : slot_assigned(false) + { } + named_slot_map_iterator(const named_slot_map_iterator& other) + : group(other.group), last_group(other.last_group), + slot_assigned(other.slot_assigned) + { + if (slot_assigned) slot_ = other.slot_; + } + named_slot_map_iterator& operator=(const named_slot_map_iterator& other) + { + slot_assigned = other.slot_assigned; + group = other.group; + last_group = other.last_group; + if (slot_assigned) slot_ = other.slot_; + return *this; + } + connection_slot_pair& dereference() const + { + return *slot_; + } + void increment() + { + ++slot_; + if (slot_ == group->second.end()) { + ++group; + init_next_group(); + } + } + bool equal(const named_slot_map_iterator& other) const { + return (group == other.group + && (group == last_group + || slot_ == other.slot_)); + } #if BOOST_WORKAROUND(_MSC_VER, <= 1400) void decrement(); diff --git a/include/boost/signals/trackable.hpp b/include/boost/signals/trackable.hpp index 544ec61..0ef9298 100644 --- a/include/boost/signals/trackable.hpp +++ b/include/boost/signals/trackable.hpp @@ -113,73 +113,50 @@ namespace BOOST_SIGNALS_NAMESPACE { } } - inline void add_if_trackable(const void*) const - { - } + inline void add_if_trackable(const void*) const { } template - inline void add_if_trackable(R (*)()) const - { - } + inline void add_if_trackable(R (*)()) const { } template - inline void add_if_trackable(R (*)(T1)) const - { - } + inline void add_if_trackable(R (*)(T1)) const { } template - inline void add_if_trackable(R (*)(T1, T2)) const - { - } + inline void add_if_trackable(R (*)(T1, T2)) const { } template - inline void add_if_trackable(R (*)(T1, T2, T3)) const - { - } + inline void add_if_trackable(R (*)(T1, T2, T3)) const { } template - inline void add_if_trackable(R (*)(T1, T2, T3, T4)) const - { - } + inline void add_if_trackable(R (*)(T1, T2, T3, T4)) const { } template - inline void add_if_trackable(R (*)(T1, T2, T3, T4, T5)) const - { - } + inline void add_if_trackable(R (*)(T1, T2, T3, T4, T5)) const { } template - inline void add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6)) const - { - } + inline void add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6)) const { } template - inline void add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7)) const - { - } + inline void add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7)) const { } template - inline void add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7, T8)) const - { - } + inline void + add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7, T8)) const { } template inline void - add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9)) const - { - } + add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9)) const { } template inline void - add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)) const - { - } + add_if_trackable(R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)) const { } std::vector& bound_objects; }; diff --git a/src/named_slot_map.cpp b/src/named_slot_map.cpp index 88a0b6a..35fe2b4 100644 --- a/src/named_slot_map.cpp +++ b/src/named_slot_map.cpp @@ -23,46 +23,6 @@ typedef std::map slot_container_type; typedef slot_container_type::iterator group_iterator; typedef slot_container_type::const_iterator const_group_iterator; -named_slot_map_iterator::named_slot_map_iterator() : slot_assigned(false) {} - -named_slot_map_iterator:: -named_slot_map_iterator(const named_slot_map_iterator& other) - : group(other.group), last_group(other.last_group), - slot_assigned(other.slot_assigned) -{ - if (slot_assigned) slot_ = other.slot_; -} - -named_slot_map_iterator& -named_slot_map_iterator::operator=(const named_slot_map_iterator& other) -{ - slot_assigned = other.slot_assigned; - group = other.group; - last_group = other.last_group; - if (slot_assigned) slot_ = other.slot_; - return *this; -} - - -connection_slot_pair& named_slot_map_iterator::dereference() const -{ return *slot_; } - -void named_slot_map_iterator::increment() -{ - ++slot_; - if (slot_ == group->second.end()) { - ++group; - init_next_group(); - } -} - -bool -named_slot_map_iterator::equal(const named_slot_map_iterator& other) const -{ - return (group == other.group - && (group == last_group - || slot_ == other.slot_)); -} #if BOOST_WORKAROUND(_MSC_VER, <= 1400) void named_slot_map_iterator::decrement() { assert(false); } diff --git a/test/dead_slot_test.cpp b/test/dead_slot_test.cpp index ded4c2b..d7ec345 100644 --- a/test/dead_slot_test.cpp +++ b/test/dead_slot_test.cpp @@ -1,6 +1,6 @@ // Boost.Signals library -// Copyright Douglas Gregor 2001-2003. Use, modification and +// Copyright (C) Douglas Gregor 2001-2006. Use, modification and // distribution is subject to the Boost Software License, Version // 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) diff --git a/test/trackable_test.cpp b/test/trackable_test.cpp index 389d129..9a6781e 100644 --- a/test/trackable_test.cpp +++ b/test/trackable_test.cpp @@ -1,6 +1,6 @@ // Boost.Signals library -// Copyright Douglas Gregor 2001-2003. Use, modification and +// Copyright Douglas Gregor 2001-2006. Use, modification and // distribution is subject to the Boost Software License, Version // 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt)