Need help with Signals?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

447 Stars 46 Forks 15 Commits 1 Opened issues


A lightweight signals and slots implementation.

Services available


Need anything else?

Contributors list

# 127,173
6 commits
# 116,578
1 commit



A lightweight "signals and slots" implementation using fast delegates.

When GUI programming in C++, delegates and the signals and slots paradigm can vastly simplify your code. It implements the Observer pattern while avoiding all the boilerplate code. I needed a lightweight and efficient implementation that I could just drop into my projects and use without adding weird macros, inheriting from crazy templates or having external dependencies. I wanted something simpler and more efficient than libsigc++, sigslot, and boost.signals.

So I was overjoyed when I discovered a very novel and efficient implementation of delegates in C++ and I realized I could make use of these to create a signals and slots implementation that would be very non-intrusive.


  • Extremely efficient (based on delegates that generate only two lines of ASM code).
  • No inheritance required.
  • No third-party preprocessor required.
  • Works seamlessly with global functions, object methods, virtual methods and static class methods.
  • Very portable. This should work on any reasonable C++ compiler.
  • Really simple to drop in and use.
  • Implemented fully in templates.


Signals.h does require STL for std::set, although this could probably be replaced with a custom set class fairly easily if you have one on hand. :)


See Example.cpp for more detailed examples. Here is a very simple one:

// Using Delegate.h

void MyFunc( int x ) { printf( "MyFunc( %d )", x ); }

// Using Signal.h

class Button {
public: Signal2< int, float > updateLabel;

void Click( void )
    updateLabel( 2, 34.5 );


class Label { public: virtual void Update( int i, float f ) { printf( "Update( %d, %.1f )", i, f ); } };

int main() { Delegate1< int > delegate; delegate.Bind( & MyFunc ); delegate( 5 );

Button myButton;
Label myLabel1;
Label myLabel2;
myButton.updateLabel.Connect( &amp; myLabel1, &amp; Label::Update );
myButton.updateLabel.Connect( &amp; myLabel2, &amp; Label::Update );

return 0;



Written by Patrick Hogan

This project includes a modified version of FastDelegates by Don Clugston. Please see Delegates.h for more information on FastDelegates.

Signals.h is released under the MIT License:
Delegates.h is released into the public domain by the author and may be used for any purpose.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.