We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Could you please add support for this code?
#include <iostream> #include <sigslot/signal.hpp> class Foo { public: Foo() = default; ~Foo() = default; Foo(const Foo &) = delete; Foo &operator=(const Foo &) = delete; Foo(Foo &&) = default; Foo &operator=(Foo &&) = default; public: void Test() { SigTest(std::make_unique<int>(3)); } public: sigslot::signal<std::unique_ptr<int> &&> SigTest; }; class Bar { public: Bar() = default; ~Bar() = default; Bar(const Bar &) = delete; Bar &operator=(const Bar &) = delete; Bar(Bar &&) = default; Bar &operator=(Bar &&) = default; public: void OnTest(std::unique_ptr<int> arg) { std::cout << "arg: " << *arg << std::endl; } }; int main() { Foo foo; Bar bar1; Bar bar2; foo.SigTest.connect(&Bar::OnTest, &bar1); // foo.SigTest.connect(&Bar::OnTest, &bar2); // should be compile time error or runtime error foo.Test(); return 0; }
Currently I need use std::shared_ptr as parameter, which will cause it is hard to manage lifetime.
std::shared_ptr
Maybe a new signal type which only take one slot is possible way to implement it.
The text was updated successfully, but these errors were encountered:
Duplicate of #18
Sorry, something went wrong.
No branches or pull requests
Could you please add support for this code?
Currently I need use
std::shared_ptr
as parameter, which will cause it is hard to manage lifetime.Maybe a new signal type which only take one slot is possible way to implement it.
The text was updated successfully, but these errors were encountered: