Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
kcenon::common::concepts::VoidCallable Concept Referenceexport

A callable type that returns void when invoked. More...

#include <callable.h>

Concept definition

template<typename F, typename... Args>
std::is_void_v<std::invoke_result_t<F, Args...>>
A callable type that can be invoked with given arguments.
Definition callable.h:62
A callable type that returns void when invoked.
Definition callable.h:80

Detailed Description

A callable type that returns void when invoked.

Use this concept for fire-and-forget tasks or callbacks that don't produce a return value.

Example usage:

template<VoidCallable F>
void execute_async(F&& func) {
std::thread([f = std::forward<F>(func)]() { f(); }).detach();
}

Definition at line 80 of file callable.h.