|
qxLib
|
Single or multicast delegate. More...
#include <delegate.h>
Single or multicast delegate.
For a singlecast version:
For a multicast version:
If a delegate has only one function inside (i.e. singlecast delegate), it's stored inplace without a container allocation. If a function is small enough (token overload with max 2 bytes captured, object + method pointer overload, weak overload with 1 byte max captured), there will be no allocations at all. The destruction callback overloads require 1 allocation for the alive marker (1 per delegate), because they need to unsubscribe safely.
| signature_t | - std::function-like signature of the delegate. For example: void(size_t, const qx::string&). If the result type satisfies qx::delegate_pipe_c, the result of each callable will be piped into the next one, and the final result will be returned by execute(). Otherwise, the result of the last callable will be returned by execute(), and the results of the previous callables will be ignored. |
Definition at line 66 of file delegate.h.