boost::signals2 2019, Mar 20 boost::signals2::signal 은 슬롯같은 것. 여기에 실행을 원하는 함수를 등록한다. signal 을 호출하면 등록된 함수를 호출한다. #include <iostream> #include <boost/signals2.hpp> struct HelloWorld { void operator()() const { std::cout << "Hello, World!" << std::endl; } }; class tempClass { public : void noReturnFunc() { std::cout << "I'm noReturnFunc" << std::endl; } }; int main() { boost::signals2::signal<void()> sig; HelloWorld hello; sig.connect(hello); tempClass tc; sig.connect(std::bind(&tempClass::noReturnFunc, &tc)); sig(); std::cout << "Hello World!\n"; } Please enable JavaScript to view the comments powered by Disqus.