C++ (Qt)template <class Friend, class R, class... Args>class signal<Friend, R(Args...)> {public: template <class Slot> void connect(Slot slot) { m_sig.connect(slot); } template <class Slot> void disconnect(Slot slot) { m_sig.disconnect(slot); } protected: friend Friend; boost::signal2::signal<R(Args...)> m_sig; void emit(Args... args) { m_sig.emit(args...); }}; class Demo {public: signal<Demo, void( int )> my_signal; void emit(int val) { my_signal.emit(val); }};
C++ (Qt)shape.visibleChanged(true);
C++ (Qt)public: void move(int x, int y);signals: void moved(int x, int y);