diff options
Diffstat (limited to 'tests/test_rvalue_ref.cc')
-rw-r--r-- | tests/test_rvalue_ref.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/test_rvalue_ref.cc b/tests/test_rvalue_ref.cc index ec81d39..4e1666b 100644 --- a/tests/test_rvalue_ref.cc +++ b/tests/test_rvalue_ref.cc @@ -21,6 +21,9 @@ struct A void foo(MoveableStruct &&) { result_stream << "A::foo(MoveableStruct&&)"; } }; +void boo(MoveableStruct &&) { + result_stream << "boo(MoveableStruct&&)"; +} } // end anonymous namespace @@ -49,6 +52,17 @@ test_slot() void test_mem_fun() { + sigc::slot<void(A &, MoveableStruct &&)> slot; + A a; + slot = sigc::mem_fun(&A::foo); + MoveableStruct x; + slot(a, std::move(x)); + util->check_result(result_stream, "A::foo(MoveableStruct&&)"); +} + +void +test_bound_mem_fun() +{ sigc::slot<void(MoveableStruct &&)> slot; A a; slot = sigc::mem_fun(a, &A::foo); @@ -57,6 +71,16 @@ test_mem_fun() util->check_result(result_stream, "A::foo(MoveableStruct&&)"); } +void +test_ptr_fun() +{ + sigc::slot<void(MoveableStruct &&)> slot; + slot = sigc::ptr_fun(&boo); + MoveableStruct x; + slot(std::move(x)); + util->check_result(result_stream, "boo(MoveableStruct&&)"); +} + int main(int argc, char* argv[]) { @@ -66,7 +90,9 @@ main(int argc, char* argv[]) test_signal(); test_slot(); + test_bound_mem_fun(); test_mem_fun(); + test_ptr_fun(); return util->get_result_and_delete_instance() ? EXIT_SUCCESS : EXIT_FAILURE; } // end main() |