I typed to fast and just repeated stuff I read somewhere. A google search yielded, that a std::function does not necessarily allocate:
When assigning a lambda with significant captures to a std::function, it will do a dynamic memory allocation!
from: https://blog.demofox.org/2015/02/25/avoiding-the-performance-hazzards-of-stdfunction/
If someone has a more reliable source, if it is fine to call callAsync() from a realtime thread, that would be useful.
EDIT: found this thread here:
Result inconclusive unfortunately. Everybody has to find out, if it works for their use case or build some huge solution around it.
