Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r56861 - in branches/release: boost/signals2 boost/signals2/detail libs/signals2 libs/signals2/test
From: fmhess_at_[hidden]
Date: 2009-10-14 23:12:00


Author: fmhess
Date: 2009-10-14 23:11:59 EDT (Wed, 14 Oct 2009)
New Revision: 56861
URL: http://svn.boost.org/trac/boost/changeset/56861

Log:
Merged some bug fixes from trunk to release.
Closes #3522.

Properties modified:
   branches/release/boost/signals2/ (props changed)
   branches/release/libs/signals2/ (props changed)
Text files modified:
   branches/release/boost/signals2/detail/slot_groups.hpp | 10 ++++++++--
   branches/release/boost/signals2/last_value.hpp | 1 -
   branches/release/libs/signals2/test/ordering_test.cpp | 25 +++++++++++++++++++++++++
   3 files changed, 33 insertions(+), 3 deletions(-)

Modified: branches/release/boost/signals2/detail/slot_groups.hpp
==============================================================================
--- branches/release/boost/signals2/detail/slot_groups.hpp (original)
+++ branches/release/boost/signals2/detail/slot_groups.hpp 2009-10-14 23:11:59 EDT (Wed, 14 Oct 2009)
@@ -46,16 +46,22 @@
       template<typename Group, typename GroupCompare, typename ValueType>
       class grouped_list
       {
+ public:
+ typedef group_key_less<Group, GroupCompare> group_key_compare_type;
       private:
         typedef std::list<ValueType> list_type;
- typedef std::map<typename group_key<Group>::type, typename list_type::iterator> map_type;
+ typedef std::map
+ <
+ typename group_key<Group>::type,
+ typename list_type::iterator,
+ group_key_compare_type
+ > map_type;
         typedef typename map_type::iterator map_iterator;
         typedef typename map_type::const_iterator const_map_iterator;
       public:
         typedef typename list_type::iterator iterator;
         typedef typename list_type::const_iterator const_iterator;
         typedef typename group_key<Group>::type group_key_type;
- typedef group_key_less<Group, GroupCompare> group_key_compare_type;
 
         grouped_list(const group_key_compare_type &group_key_compare):
           _group_key_compare(group_key_compare)

Modified: branches/release/boost/signals2/last_value.hpp
==============================================================================
--- branches/release/boost/signals2/last_value.hpp (original)
+++ branches/release/boost/signals2/last_value.hpp 2009-10-14 23:11:59 EDT (Wed, 14 Oct 2009)
@@ -35,7 +35,6 @@
       template<typename InputIterator>
       T operator()(InputIterator first, InputIterator last) const
       {
- T * resolver = 0;
         if(first == last)
         {
           boost::throw_exception(no_slots_error());

Modified: branches/release/libs/signals2/test/ordering_test.cpp
==============================================================================
--- branches/release/libs/signals2/test/ordering_test.cpp (original)
+++ branches/release/libs/signals2/test/ordering_test.cpp 2009-10-14 23:11:59 EDT (Wed, 14 Oct 2009)
@@ -14,6 +14,7 @@
 #include <algorithm>
 #include <cstdlib>
 #include <ctime>
+#include <functional>
 
 std::vector<int> valuesOutput;
 bool ungrouped1 = false;
@@ -61,6 +62,27 @@
   }
 };
 
+int return_argument(int x)
+{
+ return x;
+}
+
+void test_group_compare()
+{
+ boost::signals2::signal
+ <
+ int (),
+ boost::signals2::last_value<int>,
+ int,
+ std::greater< int >
+ > sig;
+
+ sig.connect( 1, boost::bind( &return_argument, 1) );
+ sig.connect( 2, boost::bind( &return_argument, 2) );
+
+ BOOST_CHECK(sig() == 1);
+}
+
 int test_main(int, char* [])
 {
   using namespace std;
@@ -100,5 +122,8 @@
   BOOST_CHECK(ungrouped1);
   BOOST_CHECK(ungrouped2);
   BOOST_CHECK(ungrouped3);
+
+ test_group_compare();
+
   return 0;
 }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk