Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74521 - in trunk: boost/signals libs/signals/test
From: marshall_at_[hidden]
Date: 2011-09-22 14:56:48


Author: marshall
Date: 2011-09-22 14:56:47 EDT (Thu, 22 Sep 2011)
New Revision: 74521
URL: http://svn.boost.org/trac/boost/changeset/74521

Log:
Applied patch, added test; Fixes #5521
Added:
   trunk/libs/signals/test/swap_test.cpp (contents, props changed)
Text files modified:
   trunk/boost/signals/connection.hpp | 2 +-
   trunk/libs/signals/test/Jamfile.v2 | 2 ++
   2 files changed, 3 insertions(+), 1 deletions(-)

Modified: trunk/boost/signals/connection.hpp
==============================================================================
--- trunk/boost/signals/connection.hpp (original)
+++ trunk/boost/signals/connection.hpp 2011-09-22 14:56:47 EDT (Thu, 22 Sep 2011)
@@ -132,7 +132,7 @@
 
       connection release();
 
- inline void swap(scoped_connection&);
+ void swap(scoped_connection&);
 
       scoped_connection& operator=(const connection&);
       scoped_connection& operator=(const scoped_connection&);

Modified: trunk/libs/signals/test/Jamfile.v2
==============================================================================
--- trunk/libs/signals/test/Jamfile.v2 (original)
+++ trunk/libs/signals/test/Jamfile.v2 2011-09-22 14:56:47 EDT (Thu, 22 Sep 2011)
@@ -33,6 +33,8 @@
   [ run signal_test.cpp ]
 
   [ run trackable_test.cpp ]
+
+ [ run swap_test.cpp ]
  ;
 }
       

Added: trunk/libs/signals/test/swap_test.cpp
==============================================================================
--- (empty file)
+++ trunk/libs/signals/test/swap_test.cpp 2011-09-22 14:56:47 EDT (Thu, 22 Sep 2011)
@@ -0,0 +1,23 @@
+// https://svn.boost.org/trac/boost/ticket/5521
+// claims a linker error for this.
+
+#include <boost/signal.hpp>
+#include <boost/signals/connection.hpp>
+
+struct HelloWorld
+{
+ void operator()() const
+ {
+ std::cout << "Hello, World!" << std::endl;
+ }
+};
+
+
+int main ( int argc, char *argv [] ) {
+ boost::signal<void ()> sig;
+ boost::signals::scoped_connection c1, c2;
+
+ c1 = sig.connect ( HelloWorld ());
+ std::swap ( c1, c2 );
+ 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