A header-only, thread-safe C++14 signal-slots library designed as a modern replacement for Boost.Signals2.
Sigslot is a header-only C++14 library that implements the signal-slots pattern, enabling event-driven programming and the observer pattern in C++ applications. It provides a thread-safe, lightweight alternative to Boost.Signals2, allowing objects to emit signals and connect slots (callables) for decoupled communication.
C++ developers building event-driven systems, GUI frameworks, or any application requiring decoupled component communication, particularly those seeking a modern replacement for Boost.Signals2.
Developers choose Sigslot for its thread safety, automatic lifetime tracking, and simplicity as a header-only library, offering a reliable and performant signal-slots implementation without the overhead of Boost dependencies.
A simple C++14 signal-slots implementation
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers both thread-safe (sigslot::signal) and non-thread-safe (sigslot::signal_st) variants, with unit-tested cross-thread and recursive emission safety, as highlighted in the implementation details.
Automatically disconnects slots when tracked objects like std::shared_ptr or QObject are destroyed, preventing dangling references through extensible ADL adapters, as shown in the examples.
Provides sigslot::scoped_connection for scope-bound disconnection and sigslot::connection for manual control, simplifying resource management in complex event flows.
Supports slot groups with assignable IDs to enforce predictable invocation order, useful for sequencing event handlers in ascending group order.
Deliberately omits support for signal return types, limiting use cases where slots need to aggregate or return values directly, as admitted in the README's philosophy section.
Does not handle function overloading or default arguments natively, requiring workarounds like manual casting or adapter macros, which adds boilerplate code.
On Windows with MSVC or Clang-cl, may require the /OPT:NOICF linker flag to avoid function merging, adding complexity to build configurations for some use cases.
sigslot is an open-source alternative to the following products: