Skip to content

Commit d627131

Browse files
committed
test_limit_reference.cc: Don't use auto where a slot is required
The return values of sigc::bind() and sigc::bind_return() shall be converted to sigc::slot, otherwise automatic disconnection does not work. Fixes #44
1 parent 8fb7890 commit d627131

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/test_limit_reference.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ class Base : virtual public sigc::trackable
1414
public:
1515
Base() {}
1616

17+
Base(const Base& src) = default;
18+
Base& operator=(const Base& src) = default;
1719
Base(Base&& src) = delete;
1820
Base& operator=(Base&& src) = delete;
1921
};
@@ -47,11 +49,11 @@ main(int argc, char* argv[])
4749
handler();
4850
util->check_result(result_stream, "method()");
4951

50-
auto param = sigc::bind(sigc::slot<void(Derived&)>(), std::ref(*instance));
52+
sigc::slot<void()> param = sigc::bind(sigc::slot<void(Derived&)>(), std::ref(*instance));
5153
param();
5254
util->check_result(result_stream, "");
5355

54-
auto ret = sigc::bind_return(sigc::slot<void()>(), std::ref(*instance));
56+
sigc::slot<Derived()> ret = sigc::bind_return(sigc::slot<void()>(), std::ref(*instance));
5557
ret();
5658
util->check_result(result_stream, "");
5759

0 commit comments

Comments
 (0)