1 /* Copyright 2015, The libsigc++ Development Team
2 * Assigned to public domain. Use as you wish without restriction.
5 #include "testutilities.h"
6 #include <sigc++/trackable.h>
7 #include <sigc++/signal.h>
8 #include <sigc++/functors/ptr_fun.h>
9 #include <sigc++/functors/mem_fun.h>
15 std::ostringstream result_stream;
19 result_stream << "foo(int " << i << ")";
23 } // end anonymous namespace
25 int main(int argc, char* argv[])
27 auto util = TestUtilities::get_instance();
29 if (!util->check_command_args(argc, argv))
30 return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;
33 sigc::signal<int, int> sig;
34 sig.connect(sigc::ptr_fun(&foo));
36 util->check_result(result_stream, "foo(int 1)");
38 //Test the move constructor:
39 sigc::signal<int, int> sig2(std::move(sig));
42 util->check_result(result_stream, "foo(int 2)");
44 //Test the move assignment operator:
45 sigc::signal<int, int> sig3;
46 sig3 = std::move(sig2);
49 util->check_result(result_stream, "foo(int 3)");
51 return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE;