2
0
mirror of https://github.com/boostorg/signals.git synced 2026-01-19 04:42:10 +00:00

Applied patch, added test; Fixes #5521

[SVN r74521]
This commit is contained in:
Marshall Clow
2011-09-22 18:56:47 +00:00
parent 63524f1ce1
commit 88bd2a19a3
3 changed files with 26 additions and 1 deletions

View File

@@ -132,7 +132,7 @@ namespace boost {
connection release();
inline void swap(scoped_connection&);
void swap(scoped_connection&);
scoped_connection& operator=(const connection&);
scoped_connection& operator=(const scoped_connection&);

View File

@@ -33,6 +33,8 @@ project
[ run signal_test.cpp ]
[ run trackable_test.cpp ]
[ run swap_test.cpp ]
;
}

23
test/swap_test.cpp Normal file
View File

@@ -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;
}